Class PEVersion
java.lang.Object
com.github.retrooper.packetevents.util.PEVersion
PacketEvents version.
This class represents a PacketEvents version.
- Since:
- 1.8
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint[]
asArray()
Represented as an array.clone()
Clone the PEVersion.int
Compare to another PEVersion.boolean
Is this version equal to the compared object.boolean
isNewerThan
(PEVersion version) Does thecompareTo(PEVersion)
return 1?boolean
isOlderThan
(PEVersion version) Does thecompareTo(PEVersion)
return -1?toString()
Represent the version as a string.
-
Constructor Details
-
PEVersion
public PEVersion(int... version) Specify your version using an array.- Parameters:
version
- Array version.
-
PEVersion
Specify your version using a string, for example: "1.8.9".- Parameters:
version
- String version.
-
-
Method Details
-
compareTo
Compare to another PEVersion. If we are newer than the compared version, this method will return 1. If we are older than the compared version, this method will return -1. If we are equal to the compared version, this method will return 0. Similar toInteger.compareTo(Integer)
.- Parameters:
version
- Compared version- Returns:
- Comparing to another Version.
-
isNewerThan
Does thecompareTo(PEVersion)
return 1?- Parameters:
version
- Compared version.- Returns:
- Is this newer than the compared version.
-
isOlderThan
Does thecompareTo(PEVersion)
return -1?- Parameters:
version
- Compared version.- Returns:
- Is this older than the compared version.
-
asArray
public int[] asArray()Represented as an array.- Returns:
- Array version.
-
equals
Is this version equal to the compared object. The object must be a PEVersion and the array values must be equal. -
clone
Clone the PEVersion. -
toString
Represent the version as a string.
-