Package com.palmergames.bukkit.util
Class Version
java.lang.Object
com.palmergames.bukkit.util.Version
- All Implemented Interfaces:
Comparable<Version>
Represents a numbering system of a string format.
-
Method Summary
Modifier and TypeMethodDescriptionint
boolean
static Version
fromString
(String version) Constructs a Version object from the given string.@NotNull String[]
Returns the components of the version separated by .'sint
hashCode()
boolean
isNewerThan
(@NotNull Version other) boolean
isNewerThanOrEquals
(@NotNull Version other) boolean
isOlderThan
(@NotNull Version other) boolean
isOlderThanOrEquals
(@NotNull Version other) boolean
toString()
-
Method Details
-
fromString
Constructs a Version object from the given string.This method will truncate any extraneous characters found after it matches the first qualified version string.
- Parameters:
version
- A string that contains a formatted version.- Returns:
- A new Version instance from the given string.
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Version>
-
equals
-
hashCode
public int hashCode() -
toString
-
getComponents
Returns the components of the version separated by .'s- Returns:
- A string array of the components.
-
isPreRelease
public boolean isPreRelease()- Returns:
- Whether the last component is not equal to 0
-
isNewerThanOrEquals
- Since:
- 0.99.0.8
-
isNewerThan
- Since:
- 0.99.0.8
-
isOlderThanOrEquals
- Since:
- 0.99.0.8
-
isOlderThan
- Since:
- 0.99.0.8
-