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 int
compareTo(Version otherVersion)
boolean
equals(Object object)
int
getMajor()
int
getMicro()
int
getMinor()
boolean
greaterOrEqualsThan(Version other)
Returns true ifthis
is greater or equals thanother
.boolean
greaterThan(Version other)
Returns true ifthis
is greater thatother
.int
hashCode()
boolean
inside(VersionRange range)
boolean
lesserOrEqualsThan(Version other)
Returns true ifthis
is lesser or equals thatother
.boolean
lesserThan(Version other)
Returns true ifthis
is lesser thanother
.String
toString()
String
toString(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 ifthis
is greater thatother
.- Parameters:
other
- the otherVersion
- Returns:
true
if this instance is greater than other instance, otherwisefalse
-
greaterOrEqualsThan
public boolean greaterOrEqualsThan(Version other)
Returns true ifthis
is greater or equals thanother
.- Parameters:
other
- the otherVersion
- Returns:
true
if this instance is greater or equals than other instance, otherwisefalse
-
lesserThan
public boolean lesserThan(Version other)
Returns true ifthis
is lesser thanother
.- Parameters:
other
- the otherVersion
- Returns:
true
if this instance is lesser than other instance, otherwisefalse
-
lesserOrEqualsThan
public boolean lesserOrEqualsThan(Version other)
Returns true ifthis
is lesser or equals thatother
.- Parameters:
other
- the otherVersion
- Returns:
true
if this instance is lesser or equals than other instance, otherwisefalse
-
inside
public boolean inside(VersionRange range)
-
compareTo
public int compareTo(Version otherVersion)
- Specified by:
compareTo
in interfaceComparable<Version>
-
-