Package de.xima.fc.mdl.enums
Enum EHttpVerb
- java.lang.Object
-
- java.lang.Enum<EHttpVerb>
-
- de.xima.fc.mdl.enums.EHttpVerb
-
- All Implemented Interfaces:
Serializable
,Comparable<EHttpVerb>
public enum EHttpVerb extends Enum<EHttpVerb>
A list of well-known HTTP verbs, mostly those defined by the HTTP/1.0 and HTTP/1.1 standards.- Since:
- 7.0.1
- Author:
- XIMA MEDIA GmbH
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DELETE
TheDELETE
method requests that the target resource deletes its state.GET
TheGET
method requests that the target resource transfers a representation of its state.HEAD
TheHEAD
method requests that the target resource transfers a representation of its state, like for a GET request, but without the representation data enclosed in the response body.OPTIONS
TheOPTIONS
method requests that the target resource transfers the HTTP methods that it supports.PATCH
ThePATCH
method requests that the target resource modifies its state according to the partial update defined in the representation enclosed in the request.POST
ThePOST
method requests that the target resource processes the representation enclosed in the request according to the semantics of the target resource.PUT
ThePUT
method requests that the target resource creates or updates its state with the state defined by the representation enclosed in the request.TRACE
TheTRACE
method requests that the target resource transfers the received request in the response body.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getMethodName()
static boolean
isNonStandard(String verb)
static boolean
isStandard(String verb)
boolean
isSupportsMessageBody()
static EHttpVerb
ofName(String verb)
static EHttpVerb
ofNameOrNull(String verb)
static EHttpVerb
valueOf(String name)
Returns the enum constant of this type with the specified name.static EHttpVerb[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
DELETE
public static final EHttpVerb DELETE
TheDELETE
method requests that the target resource deletes its state.
-
GET
public static final EHttpVerb GET
TheGET
method requests that the target resource transfers a representation of its state. GET requests should only retrieve data and should have no other effect.
-
HEAD
public static final EHttpVerb HEAD
TheHEAD
method requests that the target resource transfers a representation of its state, like for a GET request, but without the representation data enclosed in the response body. This is useful for retrieving the representation metadata in the response header, without having to transfer the entire representation.
-
OPTIONS
public static final EHttpVerb OPTIONS
TheOPTIONS
method requests that the target resource transfers the HTTP methods that it supports. This can be used to check the functionality of a web server by requesting '*' instead of a specific resource.
-
PATCH
public static final EHttpVerb PATCH
ThePATCH
method requests that the target resource modifies its state according to the partial update defined in the representation enclosed in the request.
-
POST
public static final EHttpVerb POST
ThePOST
method requests that the target resource processes the representation enclosed in the request according to the semantics of the target resource.
-
PUT
public static final EHttpVerb PUT
ThePUT
method requests that the target resource creates or updates its state with the state defined by the representation enclosed in the request.
-
TRACE
public static final EHttpVerb TRACE
TheTRACE
method requests that the target resource transfers the received request in the response body. That way a client can see what (if any) changes or additions have been made by intermediaries.
-
-
Method Detail
-
values
public static EHttpVerb[] 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 (EHttpVerb c : EHttpVerb.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static EHttpVerb 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 nameNullPointerException
- if the argument is null
-
getMethodName
public String getMethodName()
- Returns:
- The method name of this HTTP verb, as it should be used in the request line of an HTTP request.
-
isSupportsMessageBody
public boolean isSupportsMessageBody()
- Returns:
- Whether this HTTP method supports sending content via an HTTP message body.
-
isNonStandard
public static boolean isNonStandard(String verb)
- Parameters:
verb
- The name of an HTTP verb. This is case insensitive.- Returns:
true
is the verb is not one of the pre-definedEHttpVerb
s,false
otherwise.
-
isStandard
public static boolean isStandard(String verb)
- Parameters:
verb
- The name of an HTTP verb. This is case insensitive.- Returns:
true
is the verb is one of the pre-definedEHttpVerb
s,false
otherwise.
-
ofName
@Nonnull public static EHttpVerb ofName(String verb) throws NullPointerException, IllegalArgumentException
- Parameters:
verb
- The name of an HTTP verb. This is case insensitive.- Returns:
- The enum constant corresponding to the given name.
- Throws:
NullPointerException
- When the given verb is null.IllegalArgumentException
- When the given verb is not a validEHttpVerb
.
-
-