Enum ServiceVersion

java.lang.Object
java.lang.Enum<ServiceVersion>
org.eclipse.persistence.jpa.rs.features.ServiceVersion
All Implemented Interfaces:
Serializable, Comparable<ServiceVersion>

public enum ServiceVersion extends Enum<ServiceVersion>
JPARS service version.
Author:
Dmitry Kornilov
  • Enum Constant Details

    • NO_VERSION

      public static final ServiceVersion NO_VERSION
      Added only for legacy reasons. In early versions version number was not supported.
    • VERSION_1_0

      public static final ServiceVersion VERSION_1_0
      The same as NO_VERSION, but v1.0 is specified in the URL.
    • VERSION_2_0

      public static final ServiceVersion VERSION_2_0
      Version 2.0. Supports pagination and other new features.
    • LATEST

      public static final ServiceVersion LATEST
      The latest version.
  • Method Details

    • values

      public static ServiceVersion[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static ServiceVersion valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getCode

      public String getCode()
      Returns the version as in appears in URI.
      Returns:
      the version.
    • fromCode

      public static ServiceVersion fromCode(String version) throws IllegalArgumentException
      Returns enumeration value by version number as it appears in URI.
      Parameters:
      version - version as it appears in URI.
      Returns:
      ServiceVersion.
      Throws:
      IllegalArgumentException - in case that the passed code does not match any enumeration value.
    • getFeatureSet

      public FeatureSet getFeatureSet()
      Gets a FeatureSet related to this service version.
      Returns:
      FeatureSet related to this version.
    • hasCode

      public static boolean hasCode(String code)
      Checks if ServiceVersion with given code exists.
      Parameters:
      code - Code to check.
      Returns:
      true if exists, false if not.