Class CaseInsensitiveMap.CaseInsensitiveEntry
- All Implemented Interfaces:
Serializable
,Map.Entry<K,
V>
- Enclosing class:
CaseInsensitiveMap<K,
V>
getKey()
is called.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCaseInsensitiveEntry
(Map.Entry<K, V> entry) Constructs a CaseInsensitiveEntry from the specified entry. -
Method Summary
Methods inherited from class java.util.AbstractMap.SimpleEntry
getValue
-
Constructor Details
-
CaseInsensitiveEntry
Constructs a CaseInsensitiveEntry from the specified entry.- Parameters:
entry
- the entry to wrap
-
-
Method Details
-
getKey
Returns the key in its original String form if it was originally stored as a String, otherwise returns the key as is.
-
getOriginalKey
Returns the original key object used internally by the map. This may be a CaseInsensitiveString if the key was originally a String.- Returns:
- the original key object
-
setValue
Sets the value associated with this entry's key in the underlying map.
-
equals
For String keys, equality is based on the original String value rather than the case-insensitive representation. This ensures that entries with the same case-insensitive key but different original strings are considered distinct.
-
hashCode
public int hashCode()For String keys, the hash code is computed using the original String value rather than the case-insensitive representation.
-
toString
Returns a string representation of this map entry. The string representation consists of this entry's key followed by the equals character ("=") followed by this entry's value. For String keys, the original string value is used.
- Overrides:
toString
in classAbstractMap.SimpleEntry<K,
V> - Returns:
- a string representation of this map entry
-