Interface Version
- All Superinterfaces:
Comparable<Version>
- All Known Implementing Classes:
MinecraftVersion,PrefixedVersion,SemanticVersion,SimpleNumericVersion
A
Version is a unique name or number that describes the condition of
an object. Versions can be compared with each other and a Version is either
equal to, newer than or older than another Version.
There are various different formats to describe a Version, the most popular
format being SemanticVersion (e.g. 1.4.2).
This interface describes the base characteristics of what a Version is and
means to compare them.
- Author:
- TheBusyBiscuit
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault intThis method returns thisVersionas a human-readable format.default booleanbooleanbooleanisNewerThan(Version version) booleanisOlderThan(Version version) boolean
-
Method Details
-
isNewerThan
This method returns whether thisVersionis newer than the providedVersion. This also implies that the providedVersionis older than thisVersion, seeisOlderThan(Version).This method may throw an
IncomparableVersionsExceptionif the two versions cannot be compared with each other. -
isEqualTo
This method returns whether thisVersionis equal to the givenVersion.This method may throw an
IncomparableVersionsExceptionif the two versions cannot be compared with each other. -
isOlderThan
This method returns whether thisVersionis older than the providedVersion. This also implies that the providedVersionis newer than thisVersion, seeisNewerThan(Version).This method may throw an
IncomparableVersionsExceptionif the two versions cannot be compared with each other. -
isAtLeast
This method returns whether thisVersionis equal to or newer than the providedVersion.This method may throw an
IncomparableVersionsExceptionif the two versions cannot be compared with each other. -
isSimilar
This returns whether thisVersionis "similar" to the givenVersion. TwoVersions are considered "similar" when they can be compared to each other without causing anIncomparableVersionsException. -
getAsString
This method returns thisVersionas a human-readable format. Example:1.4.2. -
compareTo
- Specified by:
compareToin interfaceComparable<Version>
-