Enum HandlerType
-
- All Implemented Interfaces:
-
java.io.Serializable
,kotlin.Comparable
public enum HandlerType extends Enum<HandlerType>
The possible Handler types one can use in Javalin. This includes all standard HTTM methods (e.g.: GET, POST, …), as well as Javalin specific operations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
HandlerType.Companion
-
Field Summary
Fields Modifier and Type Field Description private final Boolean
isHttpMethod
private final String
name
private final Integer
ordinal
private final EnumEntries<HandlerType>
entries
-
Enum Constant Summary
Enum Constants Enum Constant Description GET
The HTTP GET method requests a representation of the specified resource.
POST
The HTTP POST method sends data to the server. The type of the body of the request is indicated by the Content-Type header.
PUT
The HTTP PUT request method creates a new resource or replaces a representation of the target resource with the request payload.
The difference between PUT and POST is that PUT is idempotent: calling it once or several times successively has the same effect (that is no side effect), whereas successive identical POST requests may have additional effects, akin to placing an order several times.
PATCH
The HTTP PATCH request method applies partial modifications to a resource.
PATCH is somewhat analogous to the "update" concept found in CRUD (in general, HTTP is different than CRUD, and the two should not be confused).
DELETE
The HTTP DELETE request method deletes the specified resource.
HEAD
The HTTP HEAD method requests the headers that would be returned if the HEAD request's URL was instead requested with the HTTP GET method.
TRACE
The HTTP TRACE method performs a message loop-back test along the path to the target resource, providing a useful debugging mechanism.
CONNECT
The HTTP CONNECT method starts two-way communications with the requested resource. It can be used to open a tunnel.
OPTIONS
The HTTP OPTIONS method requests permitted communication options for a given URL or server. A client can specify a URL with this method, or an asterisk (*) to refer to the entire server.
BEFORE
Javalin Specific: Before-handlers are matched before every request (including static files).
BEFORE_MATCHED
Javalin specific: BeforeMatched-handlers run before a request finds a matching handler
AFTER_MATCHED
Javalin specific: AfterMatched-handlers run after a request which found a matching handler
WEBSOCKET_BEFORE_UPGRADE
Javalin specific: handler ran before an http request is upgraded to websocket
WEBSOCKET_AFTER_UPGRADE
Javalin specific: handler ran after an http request is upgraded to websocket
AFTER
Javalin specific: After-handlers run after every request (even if an exception occurred)
INVALID
Javalin specific: this corresponds to a handler that is not recognized using the findByName method.
-
Method Summary
Modifier and Type Method Description final HandlerType
valueOf(String value)
Returns the enum constant of this type with the specified name. final Array<HandlerType>
values()
Returns an array containing the constants of this enum type, in the order they're declared. final Boolean
isHttpMethod()
final EnumEntries<HandlerType>
getEntries()
The possible Handler types one can use in Javalin. -
-
Method Detail
-
valueOf
final HandlerType valueOf(String value)
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:
value
- whether the handler is a standard HTTP method.
-
values
final Array<HandlerType> values()
Returns an array containing the constants of this enum type, in the order they're declared.
This method may be used to iterate over the constants.
-
isHttpMethod
final Boolean isHttpMethod()
-
getEntries
final EnumEntries<HandlerType> getEntries()
The possible Handler types one can use in Javalin. This includes all standard HTTM methods (e.g.: GET, POST, …), as well as Javalin specific operations.
-
-
-
-