Class ValueDerivingMapFactory<O,​K,​V>


  • public class ValueDerivingMapFactory<O,​K,​V>
    extends java.lang.Object
    A factory for maps that dynamically derive their looked up values from a given source object.
    Author:
    dward
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  ValueDerivingMapFactory.ValueDeriver<O,​V>
      An interface for objects that derive the value for a specific entry in the map.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Map<K,​V> getMap​(O source)
      Gets a map that derives its values from the given source.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ValueDerivingMapFactory

        public ValueDerivingMapFactory​(java.util.Map<K,​ValueDerivingMapFactory.ValueDeriver<O,​V>> valueDerivers)
        Instantiates a new value deriving map factory.
        Parameters:
        valueDerivers - a map of value derivers that derive the value of each entry from a given source
    • Method Detail

      • getMap

        public java.util.Map<K,​V> getMap​(O source)
        Gets a map that derives its values from the given source.
        Parameters:
        source - the source
        Returns:
        the map