Package de.xima.fc.mdl.enums
Enum EHttpVerb
- All Implemented Interfaces:
Serializable
,Comparable<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 ConstantsEnum ConstantDescriptionTheDELETE
method requests that the target resource deletes its state.TheGET
method requests that the target resource transfers a representation of its state.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.TheOPTIONS
method requests that the target resource transfers the HTTP methods that it supports.ThePATCH
method requests that the target resource modifies its state according to the partial update defined in the representation enclosed in the request.ThePOST
method requests that the target resource processes the representation enclosed in the request according to the semantics of the target resource.ThePUT
method requests that the target resource creates or updates its state with the state defined by the representation enclosed in the request.TheTRACE
method requests that the target resource transfers the received request in the response body. -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isNonStandard
(String verb) static boolean
isStandard
(String verb) boolean
static EHttpVerb
static EHttpVerb
ofNameOrNull
(String verb) static EHttpVerb
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 Details
-
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. GET requests should only retrieve data and should have no other effect. -
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
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
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. That way a client can see what (if any) changes or additions have been made by intermediaries.
-
-
Method Details
-
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
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
- 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
- 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
- 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
.
-
ofNameOrNull
- Parameters:
verb
- The name of an HTTP verb. This is case insensitive.- Returns:
- The enum constant corresponding to the given name.
null
if either the given verb is null, or when the given verb is not a validEHttpVerb
.
-