Module xyz.ronella.casual.trivial
Package xyz.ronella.trivial.handy.impl
Class StringKeyedMapFactory<TYPE_OUTPUT>
java.lang.Object
xyz.ronella.trivial.handy.AbstractKeyedMapLogic<String,TYPE_LOGIC,TYPE_OUTPUT>
xyz.ronella.trivial.handy.AbstractStringKeyedMapLogic<Supplier<TYPE_OUTPUT>,TYPE_OUTPUT>
xyz.ronella.trivial.handy.impl.StringKeyedMapFactory<TYPE_OUTPUT>
- Type Parameters:
TYPE_OUTPUT- The type of the output that the factory will create.
@Deprecated
public class StringKeyedMapFactory<TYPE_OUTPUT>
extends AbstractStringKeyedMapLogic<Supplier<TYPE_OUTPUT>,TYPE_OUTPUT>
Deprecated.
Use StringKeyedMapGenerator instead
A convenience class for creating a map as factory.
- Since:
- 2.2.0
-
Field Summary
Fields inherited from class xyz.ronella.trivial.handy.AbstractStringKeyedMapLogic
DEFAULT_LOGICFields inherited from class xyz.ronella.trivial.handy.AbstractKeyedMapLogic
defaultLogic, internalMap -
Constructor Summary
ConstructorsConstructorDescriptionStringKeyedMapFactory(Supplier<TYPE_OUTPUT> defaultLogic, Map.Entry<String, Supplier<TYPE_OUTPUT>>... logics) Deprecated.Creates an instance of StringKeyedMapFactoryStringKeyedMapFactory(Map.Entry<String, Supplier<TYPE_OUTPUT>>... logics) Deprecated.Creates an instance of StringKeyedMapFactoryStringKeyedMapFactory(Map<String, Supplier<TYPE_OUTPUT>> map, Supplier<TYPE_OUTPUT> defaultLogic, Map.Entry<String, Supplier<TYPE_OUTPUT>>... logics) Deprecated.Creates an instance of StringKeyedMapFactory -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Executes the logic of particular key.protected Supplier<TYPE_OUTPUT>handleDefaultLogicConstructorArgument(Supplier<TYPE_OUTPUT> defaultLogic) Deprecated.Must have the implementation to handle the null defaultLogic.Methods inherited from class xyz.ronella.trivial.handy.AbstractKeyedMapLogic
getDefaultLogic
-
Constructor Details
-
StringKeyedMapFactory
@SafeVarargs public StringKeyedMapFactory(Map<String, Supplier<TYPE_OUTPUT>> map, Supplier<TYPE_OUTPUT> defaultLogic, Map.Entry<String, Supplier<TYPE_OUTPUT>>... logics) Deprecated.Creates an instance of StringKeyedMapFactory- Parameters:
map- An external map that will be used as storage of factory.defaultLogic- The default create logic if the key used was not in the map.logics- An arrays of create logic mapped to key.
-
StringKeyedMapFactory
@SafeVarargs public StringKeyedMapFactory(Supplier<TYPE_OUTPUT> defaultLogic, Map.Entry<String, Supplier<TYPE_OUTPUT>>... logics) Deprecated.Creates an instance of StringKeyedMapFactory- Parameters:
defaultLogic- The default create logic if the key used was not in the map.logics- An arrays of create logic mapped to key.
-
StringKeyedMapFactory
Deprecated.Creates an instance of StringKeyedMapFactory- Parameters:
logics- An arrays of create logic mapped to key.
-
-
Method Details
-
handleDefaultLogicConstructorArgument
protected Supplier<TYPE_OUTPUT> handleDefaultLogicConstructorArgument(Supplier<TYPE_OUTPUT> defaultLogic) Deprecated.Description copied from class:AbstractKeyedMapLogicMust have the implementation to handle the null defaultLogic.- Specified by:
handleDefaultLogicConstructorArgumentin classAbstractKeyedMapLogic<String,Supplier<TYPE_OUTPUT>, TYPE_OUTPUT> - Parameters:
defaultLogic- The default argument received from the constructor.- Returns:
- The initial value of the internal defaultLogic.
-
get
Deprecated.Executes the logic of particular key.- Specified by:
getin classAbstractStringKeyedMapLogic<Supplier<TYPE_OUTPUT>,TYPE_OUTPUT> - Parameters:
key- The key of the create logic otherwise it will use the default create logic.- Returns:
- The typed object generated by the create logic of the particular key.
-