Contents
Class Semver
java.lang.Object
com.hypixel.hytale.common.semver.Semver
- All Implemented Interfaces:
Comparable<Semver>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns -1 if this Semver is a lower version and 1 if this Semver is a higher version, returning 0 if they are equal.static SemverfromString(String str) static SemverfromString(String str, boolean strict) Parse a string to Semver.getBuild()longgetMajor()longgetMinor()longgetPatch()String[]booleanbooleansatisfies(SemverRange range) toString()
-
Field Details
-
CODEC
-
-
Constructor Details
-
Semver
public Semver(long major, long minor, long patch) -
Semver
-
-
Method Details
-
getMajor
public long getMajor() -
getMinor
public long getMinor() -
getPatch
public long getPatch() -
getPreRelease
-
hasPreRelease
public boolean hasPreRelease() -
getBuild
-
satisfies
-
compareTo
Returns -1 if this Semver is a lower version and 1 if this Semver is a higher version, returning 0 if they are equal.- Specified by:
compareToin interfaceComparable<Semver>- Parameters:
other-- Returns:
-
toString
-
fromString
-
fromString
Parse a string to Semver. When strict is set to true we enforce x.y.z if set to false we will allow x and x.y to be parsed by filling in the blanks with zero's- Parameters:
str- The string to be parsed.strict- Enforce strict Semver parsing.- Returns:
- The Semver parsed from the string
-