Class Version

java.lang.Object
org.eclipse.jetty.start.Version
All Implemented Interfaces:
Comparable<Version>

public class Version extends Object implements Comparable<Version>
Utility class for parsing and comparing version strings.

http://www.oracle.com/technetwork/java/javase/namechange-140185.html

  • Constructor Details

    • Version

      public Version(String versionString)
  • Method Details

    • compareTo

      public int compareTo(Version other)
      Compares with other version. Does not take extension into account, as there is no reliable way to order them.
      Specified by:
      compareTo in interface Comparable<Version>
      Parameters:
      other - the other version to compare this to
      Returns:
      -1 if this is older version that other, 0 if its same version, 1 if it's newer version than other
    • getLegacyMajor

      public int getLegacyMajor()
    • getMajor

      public int getMajor()
    • getRevision

      public int getRevision()
    • getUpdate

      public int getUpdate()
    • getSuffix

      public String getSuffix()
    • isNewerThan

      public boolean isNewerThan(Version other)
    • isNewerThanOrEqualTo

      public boolean isNewerThanOrEqualTo(Version other)
    • isOlderThan

      public boolean isOlderThan(Version other)
    • isOlderThanOrEqualTo

      public boolean isOlderThanOrEqualTo(Version other)
    • isInRange

      public boolean isInRange(Version low, Version high)
      Check whether this version is in range of versions specified
      Parameters:
      low - the low part of the range
      high - the high part of the range
      Returns:
      true if this version is within the provided range
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      string representation of this version
    • toShortString

      public String toShortString()
      Return short string form (without suffix)
      Returns:
      string the short version string form