java.lang.Object
com.jnape.palatable.lambda.optics.prisms.MapPrism

public final class MapPrism extends Object
  • Constructor Details

    • MapPrism

      private MapPrism()
  • Method Details

    • valueAt

      public static <M extends Map<K, V>, K, V> Prism<Map<K,V>,M,V,V> valueAt(Fn1<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<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