Enum ServiceVersion
- java.lang.Object
-
- java.lang.Enum<ServiceVersion>
-
- org.eclipse.persistence.jpa.rs.features.ServiceVersion
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ServiceVersion>
public enum ServiceVersion extends java.lang.Enum<ServiceVersion>
JPARS service version.- Author:
- Dmitry Kornilov
- Since:
- EclipseLink 2.6.0
-
-
Enum Constant Summary
Enum Constants Enum Constant Description LATEST
The latest version.NO_VERSION
Added only for legacy reasons.VERSION_1_0
The same as NO_VERSION, but v1.0 is specified in the URL.VERSION_2_0
Version 2.0.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ServiceVersion
fromCode(java.lang.String version)
Returns enumeration value by version number as it appears in URI.java.lang.String
getCode()
Returns the version as in appears in URI.FeatureSet
getFeatureSet()
Gets aFeatureSet
related to this service version.static boolean
hasCode(java.lang.String code)
Checks if ServiceVersion with given code exists.static ServiceVersion
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static ServiceVersion[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
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 Detail
-
values
public static ServiceVersion[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ServiceVersion c : ServiceVersion.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ServiceVersion valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getCode
public java.lang.String getCode()
Returns the version as in appears in URI.- Returns:
- the version.
-
fromCode
public static ServiceVersion fromCode(java.lang.String version) throws java.lang.IllegalArgumentException
Returns enumeration value by version number as it appears in URI.- Parameters:
version
- version as it appears in URI.- Returns:
- ServiceVersion.
- Throws:
java.lang.IllegalArgumentException
- in case that the passed code does not match any enumeration value.
-
getFeatureSet
public FeatureSet getFeatureSet()
Gets aFeatureSet
related to this service version.- Returns:
FeatureSet
related to this version.
-
hasCode
public static boolean hasCode(java.lang.String code)
Checks if ServiceVersion with given code exists.- Parameters:
code
- Code to check.- Returns:
- true if exists, false if not.
-
-