public abstract class AbstractRouterGroup<M> extends Object implements RouterGroup<M>
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
resourceRouter |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractRouterGroup(M manager) |
protected |
AbstractRouterGroup(M manager,
String groupPath) |
| Modifier and Type | Method and Description |
|---|---|
RouterGroup<M> |
delete(String relativePath,
Consumer<SimpleWindwardContext> consumer)
Register function with delete method
|
<C extends EnhancedWindwardContext & HttpKind> |
delete(String relativePath,
EnhancedFunction<C,?> function)
Register function with delete method
|
<R> RouterGroup<M> |
delete(String relativePath,
Supplier<R> supplier)
Register function with delete method
|
M |
end()
Return this groups manager, so that we can bind more routers of root
|
RouterGroup<M> |
get(String relativePath,
Consumer<SimpleWindwardContext> consumer)
Register function with get method
|
<C extends EnhancedWindwardContext & HttpKind> |
get(String relativePath,
EnhancedFunction<C,?> function)
Register function with get method
|
<R> RouterGroup<M> |
get(String relativePath,
Supplier<R> supplier)
Register function with get method
|
RouterGroup<M> |
http(HttpMethod httpMethod,
String relativePath,
Consumer<SimpleWindwardContext> consumer)
Register function with specific method
|
<C extends EnhancedWindwardContext & HttpKind> |
http(HttpMethod httpMethod,
String relativePath,
EnhancedFunction<C,?> function)
Register function with specific method
|
<R> RouterGroup<M> |
http(HttpMethod httpMethod,
String relativePath,
Supplier<R> supplier)
Register function with specific method
|
<R> R |
matchRouter(String relativePath,
String method)
Find out matched router function
|
RouterGroup<M> |
post(String relativePath,
Consumer<SimpleWindwardContext> consumer)
Register function with post method
|
<C extends EnhancedWindwardContext & HttpKind> |
post(String relativePath,
EnhancedFunction<C,?> function)
Register function with post method
|
<R> RouterGroup<M> |
post(String relativePath,
Supplier<R> supplier)
Register function with post method
|
RouterGroup<M> |
put(String relativePath,
Consumer<SimpleWindwardContext> consumer)
Register function with put method
|
<C extends EnhancedWindwardContext & HttpKind> |
put(String relativePath,
EnhancedFunction<C,?> function)
Register function with put method
|
<R> RouterGroup<M> |
put(String relativePath,
Supplier<R> supplier)
Register function with put method
|
RouterGroup<M> |
resources(String staticResourceLocation,
String... pathPatterns)
Register resources path pattern for specific resource location
|
protected void |
setGroupPath(String groupPath) |
RouterGroup<M> |
sse(HttpMethod httpMethod,
String relativePath,
EnhancedFunction<SseWindwardContext,SseEjector> function)
Register SSE (server send event)
|
RouterGroup<M> |
sse(String relativePath,
EnhancedFunction<SseWindwardContext,SseEjector> function)
Register SSE (server send event)
|
RouterGroup<M> |
ws(String relativePath,
Consumer<WebSocketWindwardContext> consumer)
Register websocket function
|
protected AbstractRouterGroup(M manager)
protected void setGroupPath(String groupPath)
public M end()
RouterGroupend in interface RouterGroup<M>public <R> RouterGroup<M> get(String relativePath, Supplier<R> supplier)
Routerget in interface Router<RouterGroup<M>>R - response datarelativePath - relative pathsupplier - supplierpublic RouterGroup<M> get(String relativePath, Consumer<SimpleWindwardContext> consumer)
Routerget in interface Router<RouterGroup<M>>relativePath - relativePathconsumer - function to consumepublic <C extends EnhancedWindwardContext & HttpKind> RouterGroup<M> get(String relativePath, EnhancedFunction<C,?> function)
Routerget in interface Router<RouterGroup<M>>relativePath - relative pathfunction - function to consumepublic <R> RouterGroup<M> put(String relativePath, Supplier<R> supplier)
Routerput in interface Router<RouterGroup<M>>R - response datarelativePath - relative pathsupplier - supplierpublic RouterGroup<M> put(String relativePath, Consumer<SimpleWindwardContext> consumer)
Routerput in interface Router<RouterGroup<M>>relativePath - relative pathconsumer - function to consumepublic <C extends EnhancedWindwardContext & HttpKind> RouterGroup<M> put(String relativePath, EnhancedFunction<C,?> function)
Routerput in interface Router<RouterGroup<M>>relativePath - relative pathfunction - function to consumepublic <R> RouterGroup<M> post(String relativePath, Supplier<R> supplier)
Routerpost in interface Router<RouterGroup<M>>R - response datarelativePath - relative pathsupplier - supplierpublic RouterGroup<M> post(String relativePath, Consumer<SimpleWindwardContext> consumer)
Routerpost in interface Router<RouterGroup<M>>relativePath - relative pathconsumer - function to consumepublic <C extends EnhancedWindwardContext & HttpKind> RouterGroup<M> post(String relativePath, EnhancedFunction<C,?> function)
Routerpost in interface Router<RouterGroup<M>>relativePath - relative pathfunction - function to consumepublic <R> RouterGroup<M> delete(String relativePath, Supplier<R> supplier)
Routerdelete in interface Router<RouterGroup<M>>R - response datarelativePath - relative pathsupplier - supplierpublic RouterGroup<M> delete(String relativePath, Consumer<SimpleWindwardContext> consumer)
Routerdelete in interface Router<RouterGroup<M>>relativePath - relative pathconsumer - function to consumepublic <C extends EnhancedWindwardContext & HttpKind> RouterGroup<M> delete(String relativePath, EnhancedFunction<C,?> function)
Routerdelete in interface Router<RouterGroup<M>>relativePath - relative pathfunction - function to consumepublic RouterGroup<M> sse(String relativePath, EnhancedFunction<SseWindwardContext,SseEjector> function)
Routersse in interface Router<RouterGroup<M>>relativePath - relative pathfunction - function to consumepublic RouterGroup<M> sse(HttpMethod httpMethod, String relativePath, EnhancedFunction<SseWindwardContext,SseEjector> function)
Routersse in interface Router<RouterGroup<M>>httpMethod - http methodrelativePath - relative pathfunction - function to consumepublic RouterGroup<M> ws(String relativePath, Consumer<WebSocketWindwardContext> consumer)
Routerws in interface Router<RouterGroup<M>>relativePath - relative pathconsumer - function to consumeExtensionalWebSocketPluginpublic RouterGroup<M> resources(String staticResourceLocation, String... pathPatterns)
Routerresources in interface Router<RouterGroup<M>>staticResourceLocation - resource locationpathPatterns - resources path patternpublic <R> RouterGroup<M> http(HttpMethod httpMethod, String relativePath, Supplier<R> supplier)
Routerhttp in interface Router<RouterGroup<M>>R - response datahttpMethod - http methodrelativePath - relative pathsupplier - supplierpublic RouterGroup<M> http(HttpMethod httpMethod, String relativePath, Consumer<SimpleWindwardContext> consumer)
Routerhttp in interface Router<RouterGroup<M>>httpMethod - http methodrelativePath - relative pathconsumer - function to consumepublic <C extends EnhancedWindwardContext & HttpKind> RouterGroup<M> http(HttpMethod httpMethod, String relativePath, EnhancedFunction<C,?> function)
Routerhttp in interface Router<RouterGroup<M>>httpMethod - method of httprelativePath - relative pathfunction - function to consumepublic <R> R matchRouter(String relativePath, String method)
RouterGroupmatchRouter in interface RouterGroup<M>R - router typerelativePath - relativePathmethod - methodCopyright © 2024 flmelody. All rights reserved.