Version identifiers have four components.
Version(String) for the format of
the qualifier string.
Version objects are immutable.
| Modifier and Type | Field and Description |
|---|---|
| public static final Version | emptyVersion
The empty version "0.0.0". |
| private transient int | |
| private final int | |
| private final int | |
| private final int | |
| private final String | |
| private static final String | |
| private transient String |
| Access | Constructor and Description |
|---|---|
| public | Version(int
Major component of the version identifier. major, int Minor component of the version identifier. minor, int Micro component of the version identifier. micro)Creates a version identifier from the specified numerical components. |
| public | Version(int
Major component of the version identifier. major, int Minor component of the version identifier. minor, int Micro component of the version identifier. micro, String Qualifier component of the version identifier. If
qualifier)null is specified, then the qualifier will be set to the
empty string.Creates a version identifier from the specified components. |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: A negative integer, zero, or a positive integer if this version is less than, equal to, or greater than the specifiedVersion object.The other)Version object to be compared.Implements java. Compares this |
| public boolean | Returns: true if object is a Version and is equal
to this object; false otherwise.The object)Version object to be compared.Overrides java. Compares this |
| public int | |
| public int | |
| public int | |
| public String | Returns: The qualifier component.Returns the qualifier component of this version identifier. |
| public int | Returns: An integer which is a hash code value for this object.Overrides java. Returns a hash code value for the object. |
| private static int | |
| public static Version | Returns: AVersion object representing the version identifier. If
version is null or the empty string then
emptyVersion will be returned.String representation of the version identifier. Leading
and trailing whitespace will be ignored. version)Parses a version identifier from the specified string. |
| public String | Returns: The string representation of this version identifier.Overrides java. Returns the string representation of this version identifier. |
| pack-priv String | |
| private void | |
| public static Version | Returns: AVersion object representing the version identifier. If
version is the empty string then emptyVersion
will be returned.String representation of the version identifier. Leading
and trailing whitespace will be ignored. Must not be version)null.Returns a |
| emptyVersion | back to summary |
|---|---|
| public static final Version emptyVersion The empty version "0.0.0". | |
| hash | back to summary |
|---|---|
| private transient int hash | |
| major | back to summary |
|---|---|
| private final int major | |
| micro | back to summary |
|---|---|
| private final int micro | |
| minor | back to summary |
|---|---|
| private final int minor | |
| qualifier | back to summary |
|---|---|
| private final String qualifier | |
| SEPARATOR | back to summary |
|---|---|
| private static final String SEPARATOR | |
| versionString | back to summary |
|---|---|
| private transient String versionString | |
| Version | back to summary |
|---|---|
| public Version(int major, int minor, int micro) Creates a version identifier from the specified numerical components. The qualifier is set to the empty string.
| |
| Version | back to summary |
|---|---|
| public Version(int major, int minor, int micro, String qualifier) Creates a version identifier from the specified components.
| |
| Version | back to summary |
|---|---|
| public Version(String version) Creates a version identifier from the specified string. Version string grammar:
version ::= major('.'minor('.'micro('.'qualifier)?)?)?
major ::= digit+
minor ::= digit+
micro ::= digit+
qualifier ::= (alpha|digit|'_'|'-')+
digit ::= [0..9]
alpha ::= [a..zA..Z]
| |
| compareTo | back to summary |
|---|---|
| public int compareTo(Version other) Implements java. Compares this
A version is considered to be less than another version if its
major component is less than the other version's major component, or the
major components are equal and its minor component is less than the other
version's minor component, or the major and minor components are equal
and its micro component is less than the other version's micro component,
or the major, minor and micro components are equal and it's qualifier
component is less than the other version's qualifier component (using
A version is considered to be equal to another version if the
major, minor and micro components are equal and the qualifier component
is equal (using
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object object) Overrides java. Compares this
A version is considered to be equal to another version if the
major, minor and micro components are equal and the qualifier component
is equal (using | |
| getMajor | back to summary |
|---|---|
| public int getMajor() Returns the major component of this version identifier.
| |
| getMicro | back to summary |
|---|---|
| public int getMicro() Returns the micro component of this version identifier.
| |
| getMinor | back to summary |
|---|---|
| public int getMinor() Returns the minor component of this version identifier.
| |
| getQualifier | back to summary |
|---|---|
| public String getQualifier() Returns the qualifier component of this version identifier.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Returns a hash code value for the object.
| |
| parseInt | back to summary |
|---|---|
| private static int parseInt(String value, String version) Parse numeric component into an int. | |
| parseVersion | back to summary |
|---|---|
| public static Version parseVersion(String version) Parses a version identifier from the specified string.
See
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns the string representation of this version identifier.
The format of the version string will be | |
| toString0 | back to summary |
|---|---|
| pack-priv String toString0() Internal toString behavior
| |
| validate | back to summary |
|---|---|
| private void validate() Called by the Version constructors to validate the version components.
| |
| valueOf | back to summary |
|---|---|
| public static Version valueOf(String version) Returns a
See
This method performs a similar function as
| |