Package net.paulem.arcana.hook
Class HookCondition<K,V>
java.lang.Object
net.paulem.arcana.hook.HookCondition<K,V>
- Type Parameters:
K- the type of the keysV- the type of the values associated with each key
A key-to-value mapping used by
Hook to resolve which implementation to use for a given key.
Instances are typically assembled with HookCondition.HookConditionBuilder.-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionHookCondition(Map<K, V> hooks) Creates a new HookCondition backed by the given map. -
Method Summary
-
Constructor Details
-
HookCondition
Creates a new HookCondition backed by the given map.- Parameters:
hooks- the map of keys to values
-
-
Method Details
-
get
Returns the value registered for the given key.- Parameters:
key- the key to look up- Returns:
- the value associated with the key, or
nullif none is registered
-