Package overit.geocall.util
Class SupplierChain.Handler<I,O>
java.lang.Object
overit.geocall.util.SupplierChain.Handler<I,O>
- Type Parameters:
I- type of the input parameterO- type of the output results
- Direct Known Subclasses:
ChapterHandler,GrantsHandler,LicenseModuleHandler,OperationModeHandler,PermissionsHandler
- Enclosing class:
SupplierChain<I,O>
Interface that defined the
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the value from this handler if it is able to handle the input parameter.getAll()Get the stream containing all values that this handler can manage.final booleanhasNext()Check if there's another handler in the chain after thisfinal SupplierChain.Handler<I, O> next()Get the next handler in the chainstream()Get the stream containing all values that this handler and the following handlers can manage.
-
Constructor Details
-
Handler
public Handler()
-
-
Method Details
-
get
Get the value from this handler if it is able to handle the input parameter. Implementation note: the subclass should invoke the super implementation if it can not handle the request{@literal @}Override public O get(I input) { if (!canHandle(input)) return super.get(input); // handle the request }- Parameters:
input- the input parameter- Returns:
- the output value or null if the input can not be handled
-
next
Get the next handler in the chain- Returns:
- the next handler in the chain or
nullif there's none
-
hasNext
public final boolean hasNext()Check if there's another handler in the chain after this- Returns:
trueif there is another handler in the chain,falseotherwise
-
stream
Get the stream containing all values that this handler and the following handlers can manage.- Returns:
- the stream containing all the output values, or
Stream.empty()if there's none.
-
getAll
Get the stream containing all values that this handler can manage. For example, if this handler manages the translations contained in a dictionary, this method should return a stream for all dictionary entries.- Returns:
- the stream containing all the output values, or
Stream.empty()if there's none.
-