Case - the type of the caseHandler - the type of the handlerpublic interface Handlers<Case,Handler>
| Modifier and Type | Method and Description |
|---|---|
Collection<Handler> |
get(String context,
Case requestCase)
Gets all handlers that match given
context and requestCase. |
default Collection<Handler> |
getOrDefault(String context,
Case requestCase,
Collection<Handler> def)
The same as
get(String, Object) but if no handler is found it returns provided def collection of
handlers. |
void |
register(BiPredicate<String,Case> handlerSelector,
Handler handler)
Registers a
handler that can handle instructions matching given handlerSelector predicate. |
default void |
register(Case requestCase,
Handler handler)
Registers a
handler that can handle instructions for given requestCase regardless of context. |
default void |
register(Handler handler)
Registers a
handler that can handle instructions regardless of context or request case. |
default void |
register(String context,
Case requestCase,
Handler handler)
Registers a
handler that can handle instructions for given context and requestCase. |
default void |
register(String context,
Handler handler)
Registers a
handler that can handle instructions for given context regardless of request case. |
Collection<Handler> get(String context, Case requestCase)
context and requestCase.context - the contextrequestCase - the type of instruction to respond todefault Collection<Handler> getOrDefault(String context, Case requestCase, Collection<Handler> def)
get(String, Object) but if no handler is found it returns provided def collection of
handlers.context - the contextrequestCase - the type of instruction to respond todef - the default handlers if this registry does not contain any matching given criteriadefault void register(Handler handler)
handler that can handle instructions regardless of context or request case.handler - the handler of the instructiondefault void register(String context, Handler handler)
handler that can handle instructions for given context regardless of request case.context - the contexthandler - the handler of the instructiondefault void register(Case requestCase, Handler handler)
handler that can handle instructions for given requestCase regardless of context.requestCase - the type of instruction to respond tohandler - the handler of the instructiondefault void register(String context, Case requestCase, Handler handler)
handler that can handle instructions for given context and requestCase.context - the contextrequestCase - the type of instruction to respond tohandler - the handler of the instructionvoid register(BiPredicate<String,Case> handlerSelector, Handler handler)
handler that can handle instructions matching given handlerSelector predicate.handlerSelector - selects a handler based on context and request casehandler - the handler of the instructionCopyright © 2010–2023. All rights reserved.