Interface EditableAssociation<K,V>

Type Parameters:
K - the type of the key
V - the type of the value
All Superinterfaces:
Association<K,V>, Assortment<Association.Entry<K,V>>, Countable, Enumerable<Association.Entry<K,V>>, Iterable<Association.Entry<K,V>>
All Known Subinterfaces:
ResizableAssociation<K,V>

public interface EditableAssociation<K,V> extends Association<K,V>
An Association that permits changing the values for the present keys, but does not allow to add more keys or change the ones already associated.
  • Method Details

    • toUnmodifiable

      default Association<K,V> toUnmodifiable()
      Returns an unmodifiable view of this EditableAssociation
      Returns:
      an unmodifiable view of this EditableAssociation
    • setValue

      boolean setValue(K key, V value)
      Changes the value associated with the key. If the key is not present, nothing happens.
      Parameters:
      key -
      value -
      Returns:
      true if the key is present, false otherwise.
    • computeValue

      void computeValue(K key, BiFunction<K,V,V> computation)
      Recomputed the value of a given key delegation to a given computation. If the key is not present, nothing happens.
      Parameters:
      key - the value key
      computation - a function that receives the key, the old value and returns the new value