public enum RestAPIVersion extends Enum<RestAPIVersion>
REST API versions are global and thus apply to every REST component.
Changes that must result in an API version increment include but are not limited to: - modification of a handler url - addition of new mandatory parameters - removal of a handler/request - modifications to request/response bodies (excluding additions)
| 限定符和类型 | 类和说明 |
|---|---|
static class |
RestAPIVersion.RestAPIVersionComparator
Comparator for
RestAPIVersion that sorts versions based on their version number, i.e. |
| 限定符和类型 | 方法和说明 |
|---|---|
static RestAPIVersion |
fromURLVersionPrefix(String prefix)
Converts the given URL version prefix (e.g "v1") to a
RestAPIVersion. |
static RestAPIVersion |
getLatestVersion(Collection<RestAPIVersion> versions)
Returns the latest version from the given collection.
|
String |
getURLVersionPrefix()
Returns the URL version prefix (e.g.
|
boolean |
isDefaultVersion()
Returns whether this version is the default REST API version.
|
boolean |
isStableVersion()
Returns whether this version is considered stable.
|
static RestAPIVersion |
valueOf(String name)
返回带有指定名称的该类型的枚举常量。
|
static RestAPIVersion[] |
values()
按照声明该枚举类型的常量的顺序, 返回
包含这些常量的数组。
|
public static final RestAPIVersion V0
public static final RestAPIVersion V1
public static RestAPIVersion[] values()
for (RestAPIVersion c : RestAPIVersion.values()) System.out.println(c);
public static RestAPIVersion valueOf(String name)
name - 要返回的枚举常量的名称。IllegalArgumentException - 如果该枚举类型没有带有指定名称的常量NullPointerException - 如果参数为空值public String getURLVersionPrefix()
public boolean isDefaultVersion()
public boolean isStableVersion()
public static RestAPIVersion fromURLVersionPrefix(String prefix)
RestAPIVersion.prefix - prefix to convertedIllegalArgumentException - if the prefix doesn't match any versionpublic static RestAPIVersion getLatestVersion(Collection<RestAPIVersion> versions)
versions - possible candidatesCopyright © 2014–2022 The Apache Software Foundation. All rights reserved.