Class HookCondition<K,V>

java.lang.Object
net.paulem.arcana.hook.HookCondition<K,V>
Type Parameters:
K - the type of the keys
V - the type of the values associated with each key

public class HookCondition<K,V> extends Object
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.
  • Constructor Details

    • HookCondition

      public HookCondition(Map<K,V> hooks)
      Creates a new HookCondition backed by the given map.
      Parameters:
      hooks - the map of keys to values
  • Method Details

    • get

      public V get(K key)
      Returns the value registered for the given key.
      Parameters:
      key - the key to look up
      Returns:
      the value associated with the key, or null if none is registered