Enum Class RestHttpMethod
- All Implemented Interfaces:
Serializable,Comparable<RestHttpMethod>,Constable
Defines the supported HTTP methods for REST service calls.
- Since:
- 1.0
- Author:
- Bonitasoft
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionHTTP DELETE method for removing resources.HTTP GET method for retrieving resources.HTTP HEAD method for retrieving headers only.HTTP OPTIONS method for retrieving allowed methods.HTTP PATCH method for partial updates.HTTP POST method for creating resources.HTTP PUT method for replacing resources. -
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<RestHttpMethod>Finds an HTTP method by its key (case-insensitive).Retrieves all HTTP methods as a read-only Map.Retrieves all method keys as a read-only List.Gets a brief description of the HTTP method.getKey()Gets the HTTP method name.static booleanChecks if a given string corresponds to a valid HTTP method.booleanChecks if this HTTP method typically supports a request body.static RestHttpMethodReturns the enum constant of this class with the specified name.static RestHttpMethod[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
GET
HTTP GET method for retrieving resources. -
POST
HTTP POST method for creating resources. -
PUT
HTTP PUT method for replacing resources. -
PATCH
HTTP PATCH method for partial updates. -
DELETE
HTTP DELETE method for removing resources. -
HEAD
HTTP HEAD method for retrieving headers only. -
OPTIONS
HTTP OPTIONS method for retrieving allowed methods.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
getKey
Gets the HTTP method name.- Returns:
- The method name (e.g., "GET", "POST")
-
getDescription
Gets a brief description of the HTTP method.- Returns:
- The description
-
supportsBody
public boolean supportsBody()Checks if this HTTP method typically supports a request body.- Returns:
trueif the method supports a body
-
isValid
Checks if a given string corresponds to a valid HTTP method.- Parameters:
input- The string to validate (case-insensitive)- Returns:
trueif the string is a valid HTTP method
-
fromKey
Finds an HTTP method by its key (case-insensitive).- Parameters:
key- The key to search for- Returns:
- Optional containing the matching method, or empty if not found
-
getAllData
Retrieves all HTTP methods as a read-only Map.- Returns:
- A map containing all method data (Key -> Description)
-
getAllKeysList
Retrieves all method keys as a read-only List.- Returns:
- A list containing all HTTP method names
-