Class Version

java.lang.Object
org.codehaus.modello.model.Version
All Implemented Interfaces:
Comparable<Version>

public class Version extends Object implements Comparable<Version>
A version string is on the form <major>.<minor>.<micro>.
Author:
Trygve Laugstøl, Emmanuel Venisse
  • Field Details

    • INFINITE

      public static final Version INFINITE
  • Constructor Details

    • Version

      public Version(String version)
  • Method Details

    • getMajor

      public int getMajor()
    • getMinor

      public int getMinor()
    • getMicro

      public int getMicro()
    • greaterThan

      public boolean greaterThan(Version other)
      Returns true if this is greater that other.
      Parameters:
      other - the other Version
      Returns:
      true if this instance is greater than other instance, otherwise false
    • greaterOrEqualsThan

      public boolean greaterOrEqualsThan(Version other)
      Returns true if this is greater or equals than other.
      Parameters:
      other - the other Version
      Returns:
      true if this instance is greater or equals than other instance, otherwise false
    • lesserThan

      public boolean lesserThan(Version other)
      Returns true if this is lesser than other.
      Parameters:
      other - the other Version
      Returns:
      true if this instance is lesser than other instance, otherwise false
    • lesserOrEqualsThan

      public boolean lesserOrEqualsThan(Version other)
      Returns true if this is lesser or equals that other.
      Parameters:
      other - the other Version
      Returns:
      true if this instance is lesser or equals than other instance, otherwise false
    • inside

      public boolean inside(VersionRange range)
    • equals

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

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

      public String toString()
      Overrides:
      toString in class Object
    • toString

      public String toString(String prefix, String separator)
    • compareTo

      public int compareTo(Version otherVersion)
      Specified by:
      compareTo in interface Comparable<Version>