public class Version extends Object implements Comparable<Version>
major.minor.release.build
where any missing components are assumed to be 0.
| Modifier and Type | Class and Description |
|---|---|
static class |
Version.VersionPart
Specifies a version part.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
NOVAL |
| Constructor and Description |
|---|
Version() |
Version(int major) |
Version(int major,
int minor) |
Version(int major,
int minor,
int release) |
Version(int major,
int minor,
int release,
int build) |
Version(int major,
int minor,
int release,
int build,
String classifier) |
Version(String value) |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Version v)
Does a full comparison of all version parts.
|
int |
compareTo(Version v,
boolean includeClassifier)
Does a full comparison of all version parts.
|
int |
compareTo(Version v,
Version.VersionPart part)
Compare two versions up to and including the specified version part.
|
int |
compareTo(Version v,
Version.VersionPart part,
boolean includeClassifier)
Compare two versions up to and including the specified version part.
|
boolean |
equals(Object v)
Two version are considered equal if all their respective parts are equal and their
classifiers are equal.
|
String |
getClassifier()
Returns the version classifier, if any.
|
int |
getPart(Version.VersionPart part)
Returns the value of the specified part.
|
Version.VersionPart |
getSpecificity()
Returns the level of specificity for the version.
|
int |
hashCode() |
String |
toString() |
String |
toString(Version.VersionPart part)
Returns the text representation of the version up to and including the specified version
part.
|
String |
toString(Version.VersionPart part,
boolean includeClassifier)
Returns the text representation of the version up to and including the specified version
part.
|
public static final int NOVAL
public Version()
public Version(String value)
public Version(int major)
public Version(int major,
int minor)
public Version(int major,
int minor,
int release)
public Version(int major,
int minor,
int release,
int build)
public Version(int major,
int minor,
int release,
int build,
String classifier)
public int getPart(Version.VersionPart part)
part - The part whose value is sought.getClassifier().public String getClassifier()
public Version.VersionPart getSpecificity()
public boolean equals(Object v)
public int compareTo(Version v)
compareTo in interface Comparable<Version>public int compareTo(Version v, boolean includeClassifier)
v - The version to compareincludeClassifier - If true, include classifiers in the comparison.public int compareTo(Version v, Version.VersionPart part)
v - The version to compare.part - Compare up to and including this version part.public int compareTo(Version v, Version.VersionPart part, boolean includeClassifier)
v - The version to compare.part - Compare up to and including this version part.includeClassifier - If true, a case-sensitive string comparison of the classifiers will
be used in the event that all parts are equal.public String toString(Version.VersionPart part)
part - Pad up to and including this version part. Null means no padding.public String toString(Version.VersionPart part, boolean includeClassifier)
part - Pad up to and including this version part. Null means no padding.includeClassifier - If true, include the classifier, if any.Copyright © 2023 Fujion Framework. All rights reserved.