Package org.codehaus.mojo.versions.api
Enum Segment
- All Implemented Interfaces:
Serializable,Comparable<Segment>
Indicates the segment along with its 0-based index
- Author:
- Andrzej Jarmoniuk
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if the given segment is more major than the otherstatic SegmentCreates a segment that has a greater scope than the given segment ornullif the segment is alreadyMAJORstatic SegmentCreates a segment that has a lesser scope than the given segmentstatic Segmentof(int index) toString()intvalue()Returns the 0-based sendex indexstatic SegmentReturns the enum constant of this type with the specified name.static Segment[]values()Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOfMethods inherited from interface java.lang.Comparable
compareTo
-
Enum Constant Details
-
MAJOR
-
MINOR
-
INCREMENTAL
-
SUBINCREMENTAL
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
value
public int value()Returns the 0-based sendex index- Returns:
- 0-based sendex index
-
of
-
majorTo
Creates a segment that has a greater scope than the given segment ornullif the segment is alreadyMAJOR- Parameters:
other- segment that the new segment is to be based on- Returns:
- that has a greater scope than the given segment or
nullif the segment is alreadyMAJOR
-
minorTo
Creates a segment that has a lesser scope than the given segment- Parameters:
other- segment that the new segment is to be based on- Returns:
- that has a lesser scope than the given segment
-
isMajorTo
Returns true if the given segment is more major than the other- Parameters:
other- other segment to compare- Returns:
- true if the given segment is more major
-
toString
-