Class UnmodifiableArrayBackedMap.UnmodifiableEntry
- java.lang.Object
-
- org.apache.logging.log4j.internal.map.UnmodifiableArrayBackedMap.UnmodifiableEntry
-
- All Implemented Interfaces:
java.util.Map.Entry<java.lang.String,java.lang.String>
- Enclosing class:
- UnmodifiableArrayBackedMap
private class UnmodifiableArrayBackedMap.UnmodifiableEntry extends java.lang.Object implements java.util.Map.Entry<java.lang.String,java.lang.String>Implementation of Map.Entry. The implementation is simple since each instance contains an index in the array, then getKey() and getValue() retrieve from the array. Blocks modifications.
-
-
Field Summary
Fields Modifier and Type Field Description private intindexThis field is functionally final, but marking it as such can cause performance problems.
-
Constructor Summary
Constructors Constructor Description UnmodifiableEntry(int index)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetKey()java.lang.StringgetValue()inthashCode()Per spec, the hashcode is a function of the key and value.java.lang.StringsetValue(java.lang.String value)
-
-
-
Method Detail
-
getKey
public java.lang.String getKey()
- Specified by:
getKeyin interfacejava.util.Map.Entry<java.lang.String,java.lang.String>
-
getValue
public java.lang.String getValue()
- Specified by:
getValuein interfacejava.util.Map.Entry<java.lang.String,java.lang.String>
-
hashCode
public int hashCode()
Per spec, the hashcode is a function of the key and value. Calculation exactly matches HashMap.- Specified by:
hashCodein interfacejava.util.Map.Entry<java.lang.String,java.lang.String>- Overrides:
hashCodein classjava.lang.Object
-
setValue
public java.lang.String setValue(java.lang.String value)
- Specified by:
setValuein interfacejava.util.Map.Entry<java.lang.String,java.lang.String>
-
-