Class ApiVersion

java.lang.Object
org.geysermc.api.util.ApiVersion

public class ApiVersion extends Object
Represents a version of an api.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Describes 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

    Modifier and Type
    Method
    Description
    int
    Returns the human version of the api.
    int
    Returns the major version of the api.
    int
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      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 version
      major - the requested major version
      minor - the requested minor version
      Returns:
      a ApiVersion.Compatibility indicating whether this version may support the requested version