Interface PersistentSortedMaps.MergeConflictHandler<K,​V>

  • Enclosing class:
    PersistentSortedMaps
    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 PersistentSortedMaps.MergeConflictHandler<K,​V>
    A callback that is used when a key with two different values is encountered during the merge of two maps.
    • Method Detail

      • resolveConflict

        V resolveConflict​(K key,
                          V value1,
                          V value2)
        Resolve a conflict for one given key. This handler is called only with two values that are not considered equal according to the used Equivalence. One of the values may be null, which means that the corresponding map contains null as value for this key. The handler may return null, and in this case the resulting map will contain a mapping key -> null.
        Parameters:
        key - The key.
        value1 - The value from the first map.
        value2 - The value from the second map.
        Returns:
        The value that should be put into the resulting map.