Interface Maps.EntryTransformer<K extends @Nullable java.lang.Object,​V1 extends @Nullable java.lang.Object,​V2 extends @Nullable java.lang.Object>

  • Type Parameters:
    K - the key type of the input and output entries
    V1 - the value type of the input entry
    V2 - the value type of the output entry
    Enclosing class:
    Maps
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public static interface Maps.EntryTransformer<K extends @Nullable java.lang.Object,​V1 extends @Nullable java.lang.Object,​V2 extends @Nullable java.lang.Object>
    A transformation of the value of a key-value pair, using both key and value as inputs. To apply the transformation to a map, use Maps.transformEntries(Map, EntryTransformer).
    Since:
    7.0
    • Method Detail

      • transformEntry

        V2 transformEntry​(K key,
                          V1 value)
        Determines an output value based on a key-value pair. This method is generally expected, but not absolutely required, to have the following properties:
        Throws:
        java.lang.NullPointerException - if the key or value is null and this transformer does not accept null arguments