Class MapPrism


  • public final class MapPrism
    extends java.lang.Object
    Prisms for Maps.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private MapPrism()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <M extends java.util.Map<K,​V>,​K,​V>
      Prism<java.util.Map<K,​V>,​M,​V,​V>
      valueAt​(Fn1<java.util.Map<K,​V>,​M> copyFn, K k)
      A Prism that focuses on the value at a key in a Map, and produces an instance of M on the way back out.
      static <K,​V>
      Prism.Simple<java.util.Map<K,​V>,​V>
      valueAt​(K k)
      A Prism that focuses on the value at a key in a Map making no guarantees about the Map interface.
      • Methods inherited from class java.lang.Object

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

      • MapPrism

        private MapPrism()
    • Method Detail

      • valueAt

        public static <M extends java.util.Map<K,​V>,​K,​V> Prism<java.util.Map<K,​V>,​M,​V,​V> valueAt​(Fn1<java.util.Map<K,​V>,​M> copyFn,
                                                                                                                                           K k)
        A Prism that focuses on the value at a key in a Map, and produces an instance of M on the way back out.
        Type Parameters:
        M - the Map subtype
        K - the key type
        V - the value type
        Parameters:
        copyFn - the copy function
        k - the key to focus on
        Returns:
        the Prism
      • valueAt

        public static <K,​V> Prism.Simple<java.util.Map<K,​V>,​V> valueAt​(K k)
        A Prism that focuses on the value at a key in a Map making no guarantees about the Map interface.
        Type Parameters:
        K - the key type
        V - the value type
        Parameters:
        k - the key to focus on
        Returns:
        the Prism