Interface VersionScheme


public interface VersionScheme
Interface defining a strategy to compare two version strings and return the "greater" (more recent) of the two, or null if comparison is not possible under the scheme.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final VersionScheme
    A simple decimal-based version scheme: splits on dots and compares each numeric segment.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable String
    compare(@NotNull String first, @NotNull String second)
    Compares two version identifiers according to a custom scheme.
  • Field Details

    • DECIMAL_SCHEME

      static final VersionScheme DECIMAL_SCHEME
      A simple decimal-based version scheme: splits on dots and compares each numeric segment. If one array is longer, that version is considered newer.
  • Method Details

    • compare

      @Nullable @Nullable String compare(@NotNull @NotNull String first, @NotNull @NotNull String second)
      Compares two version identifiers according to a custom scheme.
      Parameters:
      first - the currently installed version (non-null)
      second - the remote/latest version to compare against (non-null)
      Returns:
      the version string representing the newer version, or null if the scheme cannot compare the inputs