Package org.geysermc.api.util
Class ApiVersion
java.lang.Object
org.geysermc.api.util.ApiVersion
Represents a version of an api.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDescribes compatibility between the current version of an API and a requested version -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioninthuman()Returns the human version of the api.intmajor()Returns the major version of the api.intminor()Returns the minor version of the api.supportsRequestedVersion(int human, int major, int minor) Checks whether an API described by this version has a good likelihood of supporting an API consumer.
-
Constructor Details
-
ApiVersion
public ApiVersion(int human, int major, int minor)
-
-
Method Details
-
human
public int human()Returns the human version of the api. -
major
public int major()Returns the major version of the api. -
minor
public int minor()Returns the minor version of the api. -
supportsRequestedVersion
Checks whether an API described by this version has a good likelihood of supporting an API consumer.The compatibility is described as follows: The human version must match. The requested major version must be equal or smaller than this major version. If the major versions are equal, the requested minor version must be equal or smaller than this minor version.
- Parameters:
human- the requested human versionmajor- the requested major versionminor- the requested minor version- Returns:
- a
ApiVersion.Compatibilityindicating whether this version may support the requested version
-