public class Route
extends java.lang.Object
Constructor and Description |
---|
Route(int httpMethod,
java.lang.String path,
RequestHandler handler)
Constructs a new instance of Route.
|
Route(int httpMethod,
java.lang.String path,
java.lang.String acceptType,
RequestHandler handler)
Constructs a new instance of Route.
|
Modifier and Type | Method and Description |
---|---|
boolean |
acceptAllContentTypes()
Checks if this route accepts all content types.
|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getAcceptType()
Gets the acceptType.
|
RequestHandler |
getHandler()
Gets the request handler associated with this route.
|
int |
getHttpMethod()
Gets the integer value associated with the HTTP method of the route.
|
java.lang.String |
getHttpMethodAsString()
Returns the HTTP method of this route as a String.
|
java.lang.String |
getPath()
Gets the path (URI) mapped in this route.
|
int |
hashCode() |
public Route(int httpMethod, java.lang.String path, RequestHandler handler)
httpMethod
- HTTP method HttpRequest.GET
HttpRequest.POST
HttpRequest.DELETE
HttpRequest.PUT
path
- request pathhandler
- request handlerpublic Route(int httpMethod, java.lang.String path, @Nullable java.lang.String acceptType, RequestHandler handler)
httpMethod
- HTTP method HttpRequest.GET
HttpRequest.POST
HttpRequest.DELETE
HttpRequest.PUT
path
- request pathacceptType
- accepted content typehandler
- request handlerpublic java.lang.String getPath()
public int getHttpMethod()
HttpRequest.GET
HttpRequest.POST
HttpRequest.PUT
HttpRequest.DELETE
getHttpMethodAsString()
can be used to get the string representation of the http method.@Nullable public java.lang.String getAcceptType()
public RequestHandler getHandler()
public boolean acceptAllContentTypes()
public java.lang.String getHttpMethodAsString()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(@Nullable java.lang.Object obj)
equals
in class java.lang.Object