Package org.codehaus.modello.model
Class Version
- java.lang.Object
-
- org.codehaus.modello.model.Version
-
- All Implemented Interfaces:
java.lang.Comparable<Version>
public class Version extends java.lang.Object implements java.lang.Comparable<Version>
A version string is on the form <major>.<minor>.<micro>.- Author:
- Trygve Laugstøl, Emmanuel Venisse
-
-
Constructor Summary
Constructors Constructor Description Version(java.lang.String version)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Version otherVersion)booleanequals(java.lang.Object object)intgetMajor()intgetMicro()intgetMinor()booleangreaterOrEqualsThan(Version other)Returns true ifthisis greater or equals thanother.booleangreaterThan(Version other)Returns true ifthisis greater thatother.inthashCode()booleaninside(VersionRange range)booleanlesserOrEqualsThan(Version other)Returns true ifthisis lesser or equals thatother.booleanlesserThan(Version other)Returns true ifthisis lesser thanother.java.lang.StringtoString()java.lang.StringtoString(java.lang.String prefix, java.lang.String separator)
-
-
-
Field Detail
-
INFINITE
public static final Version INFINITE
-
-
Method Detail
-
getMajor
public int getMajor()
-
getMinor
public int getMinor()
-
getMicro
public int getMicro()
-
greaterThan
public boolean greaterThan(Version other)
Returns true ifthisis greater thatother.- Parameters:
other- the otherVersion- Returns:
trueif this instance is greater than other instance, otherwisefalse
-
greaterOrEqualsThan
public boolean greaterOrEqualsThan(Version other)
Returns true ifthisis greater or equals thanother.- Parameters:
other- the otherVersion- Returns:
trueif this instance is greater or equals than other instance, otherwisefalse
-
lesserThan
public boolean lesserThan(Version other)
Returns true ifthisis lesser thanother.- Parameters:
other- the otherVersion- Returns:
trueif this instance is lesser than other instance, otherwisefalse
-
lesserOrEqualsThan
public boolean lesserOrEqualsThan(Version other)
Returns true ifthisis lesser or equals thatother.- Parameters:
other- the otherVersion- Returns:
trueif this instance is lesser or equals than other instance, otherwisefalse
-
inside
public boolean inside(VersionRange range)
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toString
public java.lang.String toString(java.lang.String prefix, java.lang.String separator)
-
-