java.lang.Object
net.odoframework.service.web.HttpRouter
- All Implemented Interfaces:
BiFunction<WebRequest,Invocation,WebResponse>,ServiceFunction<WebRequest,WebResponse>,WebFunction
public abstract class HttpRouter extends Object implements WebFunction
-
Constructor Summary
Constructors Constructor Description HttpRouter(Json json) -
Method Summary
Modifier and Type Method Description HttpRouteraddMapping(String operation, String path, BiFunction<WebRequest,Invocation,WebResponse> handler)WebResponseapply(WebRequest s, Invocation invocation)abstract voidbuild()HttpRouterdelete(String path, BiFunction<WebRequest,Invocation,WebResponse> handler)HttpRouterget(String path, BiFunction<WebRequest,Invocation,WebResponse> handler)Map<String,Map<String,BiFunction<WebRequest,Invocation,WebResponse>>>getHandlers()JsongetJson()HttpRouterhead(String path, BiFunction<WebRequest,Invocation,WebResponse> handler)protected <T> WebResponsenotFound(Object body)protected <T> WebResponseok(Object body)HttpRouterpost(String path, BiFunction<WebRequest,Invocation,WebResponse> handler)HttpRouterput(String path, BiFunction<WebRequest,Invocation,WebResponse> handler)protected <T> WebResponseserverError(Object body)protected <T> WebResponseuserError(Object body)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.function.BiFunction
andThenMethods inherited from interface net.odoframework.service.web.WebFunction
created, notFound, ok, response, serverError, unsupported, userError
-
Constructor Details
-
HttpRouter
-
-
Method Details
-
apply
- Specified by:
applyin interfaceBiFunction<WebRequest,Invocation,WebResponse>
-
addMapping
public HttpRouter addMapping(String operation, String path, BiFunction<WebRequest,Invocation,WebResponse> handler) -
get
-
post
-
put
-
delete
-
head
-
ok
-
userError
-
serverError
-
notFound
-
build
public abstract void build() -
getJson
-
getHandlers
-