Package org.codehaus.modello.model
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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Version otherVersion)booleanequals(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.StringtoString()StringtoString(String prefix, String separator)
-
-
-
Field Detail
-
INFINITE
public static final Version INFINITE
-
-
Constructor Detail
-
Version
public Version(String version)
-
-
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)
-
compareTo
public int compareTo(Version otherVersion)
- Specified by:
compareToin interfaceComparable<Version>
-
-