Interface ArrayAssignMapper<K,V,T>

All Superinterfaces:
ArraySizeMapper<T>
All Known Subinterfaces:
ArrayUpdateMapper<K,V,T>
All Known Implementing Classes:
HashMap, HashMap.Builder, HashSet

public interface ArrayAssignMapper<K,V,T> extends ArraySizeMapper<T>
  • Method Summary

    Modifier and Type
    Method
    Description
    mappedAssign(K key, V value)
    Called during assign operation to create a new mapping for the given key and value.
    mappedAssign(T current, K key, V value)
    Called during assign operation to replace an existing mapping for the given key and value.

    Methods inherited from interface org.javimmutable.collections.array.ArraySizeMapper

    mappedSize
  • Method Details

    • mappedAssign

      @Nonnull T mappedAssign(@Nonnull K key, V value)
      Called during assign operation to create a new mapping for the given key and value.
      Parameters:
      key - key being assigned to
      value - value being assigned
      Returns:
      non-null mapping
    • mappedAssign

      @Nonnull T mappedAssign(@Nonnull T current, @Nonnull K key, V value)
      Called during assign operation to replace an existing mapping for the given key and value.
      Parameters:
      current - mapping to be replaced
      key - key being assigned to
      value - value being assigned
      Returns:
      same to keep mapping or non-null to replace mapping