Package megamek

Class Version

java.lang.Object
megamek.Version
All Implemented Interfaces:
Serializable, Comparable<Version>

public final class Version extends Object implements Comparable<Version>, Serializable
This is used for versioning, and to track the current Version the suite is running at.
See Also:
  • Constructor Details

  • Method Details

    • getRelease

      public int getRelease()
    • setRelease

      public void setRelease(int release)
    • getMajor

      public int getMajor()
    • setMajor

      public void setMajor(int major)
    • getMinor

      public int getMinor()
    • setMinor

      public void setMinor(int minor)
    • isSnapshot

      public boolean isSnapshot()
    • setSnapshot

      public void setSnapshot(boolean snapshot)
    • isHigherThan

      public boolean isHigherThan(String other)
      Use this method to determine if this version is higher than the version passed
      Parameters:
      other - The version we want to see if it is lower than this version
      Returns:
      true if this is higher than checkVersion
    • isHigherThan

      public boolean isHigherThan(Version other)
      Use this method to determine if the version passed is less than this Version object.
      Parameters:
      other - The version we want to see if is less than this version
      Returns:
      true if checkVersion is less than this Version object
    • isLowerThan

      public boolean isLowerThan(String other)
      Use this method to determine if this version is lower than the version passed
      Parameters:
      other - The version we want to see if it is higher than this version.
      Returns:
      true if this is lower than checkVersion
    • isLowerThan

      public boolean isLowerThan(Version other)
      Use this method to determine if this version is lower than the version passed
      Parameters:
      other - The version we want to see if it is higher than this version.
      Returns:
      true if this is lower than checkVersion
    • isBetween

      public boolean isBetween(String lower, String upper)
      Parameters:
      lower - the lower Version bound (exclusive)
      upper - the upper Version bound (exclusive)
      Returns:
      true if the version is between lower and upper versions, both exclusive
    • isBetween

      public boolean isBetween(Version lower, Version upper)
      Parameters:
      lower - the lower Version bound (exclusive)
      upper - the upper Version bound (exclusive)
      Returns:
      true is the version is between lower and upper versions, both exclusive
    • is

      public boolean is(String other)
      Parameters:
      other - The version we want to see if it is the same as this version.
      Returns:
      true if this is same version as the other
    • is

      public boolean is(Version other)
      Parameters:
      other - The version we want to see if it is the same as this version.
      Returns:
      true if this is same version as the other
    • compareTo

      public int compareTo(Version other)
      Specified by:
      compareTo in interface Comparable<Version>
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • writeToXML

      public void writeToXML(PrintWriter pw, int indent)
    • fillFromText

      public void fillFromText(@Nullable String text)
    • toString

      public String toString()
      Overrides:
      toString in class Object