public class LambdaRoute<T extends ComponentsProvider>
extends Route
Describes an endpoint in a REST API whose requests are handled by a lambda.
It contains
The HTTP method it accepts, for example GET or POST
The path to the endpoint, for example /foo/bar
The code that is run when the endpoint receives a request (the "handler")
The authorisation needed to invoke the endpoint
Route.Companion| Constructor and Description |
|---|
LambdaRoute(HttpMethod method,
java.lang.String path,
Function2<? super T,? super ws.osiris.core.Request,ws.osiris.core.Response> handler,
Auth auth,
boolean cors)
Describes an endpoint in a REST API whose requests are handled by a lambda.
|
| Modifier and Type | Method and Description |
|---|---|
HttpMethod |
component1() |
java.lang.String |
component2() |
Function2<T,ws.osiris.core.Request,ws.osiris.core.Response> |
component3() |
Auth |
component4() |
boolean |
component5() |
LambdaRoute<T> |
copy(HttpMethod method,
java.lang.String path,
Function2<? super T,? super ws.osiris.core.Request,ws.osiris.core.Response> handler,
Auth auth,
boolean cors)
Describes an endpoint in a REST API whose requests are handled by a lambda.
|
boolean |
equals(java.lang.Object p) |
Auth |
getAuth() |
boolean |
getCors() |
Function2<T,ws.osiris.core.Request,ws.osiris.core.Response> |
getHandler() |
HttpMethod |
getMethod() |
java.lang.String |
getPath() |
int |
hashCode() |
java.lang.String |
toString() |
public LambdaRoute(HttpMethod method, java.lang.String path, Function2<? super T,? super ws.osiris.core.Request,ws.osiris.core.Response> handler, Auth auth, boolean cors)
Describes an endpoint in a REST API whose requests are handled by a lambda.
It contains
The HTTP method it accepts, for example GET or POST
The path to the endpoint, for example /foo/bar
The code that is run when the endpoint receives a request (the "handler")
The authorisation needed to invoke the endpoint
public HttpMethod getMethod()
public java.lang.String getPath()
public Function2<T,ws.osiris.core.Request,ws.osiris.core.Response> getHandler()
public Auth getAuth()
public boolean getCors()
public HttpMethod component1()
public java.lang.String component2()
public Function2<T,ws.osiris.core.Request,ws.osiris.core.Response> component3()
public Auth component4()
public boolean component5()
public LambdaRoute<T> copy(HttpMethod method, java.lang.String path, Function2<? super T,? super ws.osiris.core.Request,ws.osiris.core.Response> handler, Auth auth, boolean cors)
Describes an endpoint in a REST API whose requests are handled by a lambda.
It contains
The HTTP method it accepts, for example GET or POST
The path to the endpoint, for example /foo/bar
The code that is run when the endpoint receives a request (the "handler")
The authorisation needed to invoke the endpoint
public java.lang.String toString()
public int hashCode()
public boolean equals(java.lang.Object p)