public enum ApiVersion extends Enum<ApiVersion>
Enum Constant and Description |
---|
V2
Version 2 (supported by Spring Boot 2.0+).
|
V3
Version 3 (supported by Spring Boot 2.2+).
|
Modifier and Type | Field and Description |
---|---|
static ApiVersion |
LATEST
The latest API version.
|
Modifier and Type | Method and Description |
---|---|
static ApiVersion |
fromHttpHeaders(Map<String,List<String>> headers)
Return the
ApiVersion to use based on the HTTP request headers. |
static ApiVersion |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ApiVersion[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ApiVersion V2
public static final ApiVersion V3
public static final ApiVersion LATEST
public static ApiVersion[] values()
for (ApiVersion c : ApiVersion.values()) System.out.println(c);
public static ApiVersion valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static ApiVersion fromHttpHeaders(Map<String,List<String>> headers)
ApiVersion
to use based on the HTTP request headers. The version
will be deduced based on the Accept
header.headers
- the HTTP headers