Interface CustomCollectors.DuplicateHandler<K,V>

Type Parameters:
K - the Java type of the map's keys
V - the Java type of the map's values
Enclosing class:
CustomCollectors
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 CustomCollectors.DuplicateHandler<K,V>
A handler that supports resolving duplicate keys while inserting values into a map.
  • Method Summary

    Modifier and Type
    Method
    Description
    handle(K key, V value1, V value2)
    The handler callback.
  • Method Details

    • handle

      @NonNull V handle(K key, @NonNull V value1, V value2)
      The handler callback.
      Parameters:
      key - the duplicate key
      value1 - the first value associated with the key
      value2 - the second value associated with the key
      Returns:
      the value to insert into the map