Module xyz.ronella.casual.trivial
Package xyz.ronella.trivial.handy
Class AbstractStringKeyedMapLogic<TYPE_LOGIC,TYPE_OUTPUT>
java.lang.Object
xyz.ronella.trivial.handy.AbstractKeyedMapLogic<String,TYPE_LOGIC,TYPE_OUTPUT>
xyz.ronella.trivial.handy.AbstractStringKeyedMapLogic<TYPE_LOGIC,TYPE_OUTPUT>
- Type Parameters:
TYPE_LOGIC- The type of logic that the map will hold.TYPE_OUTPUT- The type of output that the logic will create.
- Direct Known Subclasses:
StringKeyedMapExecutor,StringKeyedMapFactory,StringKeyedMapGenerator
public abstract class AbstractStringKeyedMapLogic<TYPE_LOGIC,TYPE_OUTPUT>
extends AbstractKeyedMapLogic<String,TYPE_LOGIC,TYPE_OUTPUT>
The base class of the StringKeyedMapLogic implementations.
- Since:
- 2.2.0
-
Field Summary
FieldsFields inherited from class xyz.ronella.trivial.handy.AbstractKeyedMapLogic
defaultLogic, internalMap -
Constructor Summary
ConstructorsConstructorDescriptionAbstractStringKeyedMapLogic(Map<String, TYPE_LOGIC> map, TYPE_LOGIC defaultLogic, Map.Entry<String, TYPE_LOGIC>... logics) Creates an instance of AbstractStringKeyedMapLogic -
Method Summary
Modifier and TypeMethodDescriptionabstract Optional<TYPE_OUTPUT>Must have the implementation on how to get the logic based on a key and must be able to handle if that key doesn't exists.Methods inherited from class xyz.ronella.trivial.handy.AbstractKeyedMapLogic
getDefaultLogic, handleDefaultLogicConstructorArgument
-
Field Details
-
DEFAULT_LOGIC
The key for the default logic.- See Also:
-
-
Constructor Details
-
AbstractStringKeyedMapLogic
@SafeVarargs public AbstractStringKeyedMapLogic(Map<String, TYPE_LOGIC> map, TYPE_LOGIC defaultLogic, Map.Entry<String, TYPE_LOGIC>... logics) Creates an instance of AbstractStringKeyedMapLogic- Parameters:
map- An external map that will be used as storage of logic.defaultLogic- The default create logic if the key used was not in the map.logics- An arrays of create logic mapped to key.
-
-
Method Details
-
get
Must have the implementation on how to get the logic based on a key and must be able to handle if that key doesn't exists.- Parameters:
key- The target key of the corresponding logic.- Returns:
- An optional logic implementation.
-