Package org.geysermc.api.util
Class ApiVersion
- java.lang.Object
-
- org.geysermc.api.util.ApiVersion
-
public class ApiVersion extends java.lang.ObjectRepresents a version of an api.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classApiVersion.CompatibilityDescribes compatibility between the current version of an API and a requested version
-
Constructor Summary
Constructors Constructor Description ApiVersion(int human, int major, int minor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description inthuman()Returns the human version of the api.intmajor()Returns the major version of the api.intminor()Returns the minor version of the api.ApiVersion.CompatibilitysupportsRequestedVersion(int human, int major, int minor)Checks whether an API described by this version has a good likelihood of supporting an API consumer.
-
-
-
Method Detail
-
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
public ApiVersion.Compatibility supportsRequestedVersion(int human, int major, int minor)
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
-
-