Class MutableEntry<K,V>

java.lang.Object
net.luis.utils.collection.util.SimpleEntry<K,V>
net.luis.utils.collection.util.MutableEntry<K,V>
Type Parameters:
K - The type of the key
V - The type of the value
All Implemented Interfaces:
Map.Entry<K,V>

public class MutableEntry<K,V> extends SimpleEntry<K,V>
A mutable implementation of the Map.Entry interface.
See Also:
  • Constructor Details

    • MutableEntry

      public MutableEntry(@NotNull K key, @Nullable V value)
      Constructs a new mutable entry with the specified key and value.
      Parameters:
      key - The key of the entry
      value - The value of the entry
      Throws:
      NullPointerException - If the key is null
  • Method Details

    • setValue

      @Nullable public V setValue(@Nullable V value)
      Sets the value of this entry to the specified value.
      Specified by:
      setValue in interface Map.Entry<K,V>
      Overrides:
      setValue in class SimpleEntry<K,V>
      Parameters:
      value - The new value of this entry
      Returns:
      The old value of this entry
    • toString

      public String toString()
      Overrides:
      toString in class SimpleEntry<K,V>