Package com.mooltiverse.oss.nyx.version
Class Version
- java.lang.Object
-
- com.mooltiverse.oss.nyx.version.Version
-
- All Implemented Interfaces:
Serializable
,Cloneable
- Direct Known Subclasses:
SemanticVersion
public abstract class Version extends Object implements Cloneable, Serializable
The superclass of Version classes.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Version()
Builds the version.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract Version
bump(String id)
Returns a new instance with the number identified by the given value bumped.abstract boolean
equals(Object obj)
Returnstrue
if this version is equal to the given object,false
otherwiseabstract Scheme
getScheme()
Returns the scheme that identifies the implementationabstract int
hashCode()
Returns the hash code for this objectabstract String
toString()
Returns the string representation of this version
-
-
-
Method Detail
-
hashCode
public abstract int hashCode()
Returns the hash code for this object
-
equals
public abstract boolean equals(Object obj)
Returnstrue
if this version is equal to the given object,false
otherwise
-
getScheme
public abstract Scheme getScheme()
Returns the scheme that identifies the implementation- Returns:
- the scheme that identifies the implementation
-
toString
public abstract String toString()
Returns the string representation of this version
-
bump
public abstract Version bump(String id)
Returns a new instance with the number identified by the given value bumped. The supported identifiers depend on the concrete subclass.- Parameters:
id
- the name of the identifier to bump- Returns:
- a new instance with the number identified by the given value bumped.
- Throws:
NullPointerException
- ifnull
is passedIllegalArgumentException
- if the given string is empty, contains illegal characters or does not represent a valid identifier to be bumped
-
-