Package io.microsphere.collection
Class DefaultEntry<K,V>
- java.lang.Object
-
- io.microsphere.collection.DefaultEntry<K,V>
-
- Type Parameters:
K- the type of the keyV- the type of the value
- All Implemented Interfaces:
java.util.Map.Entry<K,V>
- Direct Known Subclasses:
ImmutableEntry
public class DefaultEntry<K,V> extends java.lang.Object implements java.util.Map.Entry<K,V>A default implementation of theMap.Entryinterface, representing a key-value pair. This class provides an immutable key and a mutable value, allowing for updates to the value while keeping the same key. It is suitable for use in custom map implementations or other scenarios where a modifiable entry needs to be maintained.- Since:
- 1.0.0
- Author:
- Mercy
- See Also:
Map.Entry
-
-
Constructor Summary
Constructors Constructor Description DefaultEntry(K key, V value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)KgetKey()VgetValue()inthashCode()static <K,V>
DefaultEntry<K,V>of(K key, V value)Create a new instance ofDefaultEntrywith the specified key and value.VsetValue(V value)java.lang.StringtoString()
-
-
-
Method Detail
-
of
public static <K,V> DefaultEntry<K,V> of(K key, V value)
Create a new instance ofDefaultEntrywith the specified key and value.- Type Parameters:
K- the type of the keyV- the type of the value- Parameters:
key- the keyvalue- the value- Returns:
- a new instance of
DefaultEntry
-
equals
public boolean equals(java.lang.Object o)
-
hashCode
public int hashCode()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-