Class VersionComparator

java.lang.Object
one.tranic.t.base.parse.version.VersionComparator

public class VersionComparator extends Object
The VersionComparator class provides utility methods for comparing software version strings.

This comparison takes into account both numeric and alphanumeric segments of the versions, including handling different formats such as pre-release identifiers or build metadata.

  • Constructor Details

    • VersionComparator

      public VersionComparator()
  • Method Details

    • cmpVer

      public static int cmpVer(String vLocal, String vRemote)
      Compares two version strings and returns an integer indicating their relative order.

      This method accounts for numeric and alphanumeric segments in the version strings.

      Parameters:
      vLocal - the local version string to be compared
      vRemote - the remote version string to be compared
      Returns:
      a negative integer if vLocal is less than vRemote, zero if both versions are equal, or a positive integer if vLocal is greater than vRemote