Top Description Methods
org.apache.logging.log4j.util

public Interface StringMap

extends ReadOnlyStringMap
Known Direct Subinterfaces
org.apache.logging.log4j.util.IndexedStringMap

Exposes methods to add and remove key-value pairs to and from ReadOnlyStringMap.
Since
2.7
See Also
ReadOnlyStringMap

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Removes all key-value pairs from this collection.

public boolean

Returns:

true if this object is the same as the obj argument; false otherwise.
equals
(final Object
the reference object with which to compare.
obj
)

Indicates whether some other object is "equal to" this one.

public void
freeze()

Makes this collection immutable.

public int

Returns:

a hash code value for this object.
hashCode
()

Returns a hash code value for the object.

public boolean

Returns:

true if this object has been frozen, false otherwise
isFrozen
()

Returns true if this object has been frozen, false otherwise.

public void
putAll(final ReadOnlyStringMap
the ReadOnlyStringMap to copy key-value pairs from
source
)

Copies all key-value pairs from the specified ReadOnlyStringMap into this StringMap.

public void
putValue(final String
the key to add or remove. Keys may be null.
key
,
final Object
the value to add. Values may be null.
value
)

Puts the specified key-value pair into the collection.

public void
remove(final String
the key to remove. May be null.
key
)

Removes the key-value pair for the specified key from this data structure.

Inherited from org.apache.logging.log4j.util.ReadOnlyStringMap:
containsKeyforEachforEachgetValueisEmptysizetoMap

Method Detail

clearback to summary
public void clear()

Removes all key-value pairs from this collection.

Exceptions
ConcurrentModificationException:
some implementations may not support structural modifications to this data structure while iterating over the contents with forEach(BiConsumer) or forEach(TriConsumer, Object).
UnsupportedOperationException:
if this collection has been frozen.
equalsback to summary
public boolean equals(final Object obj)

Indicates whether some other object is "equal to" this one.

Parameters
obj:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
See Also
hashCode()
freezeback to summary
public void freeze()

Makes this collection immutable. Attempts to modify the collection after the freeze() method was called will result in an UnsupportedOperationException being thrown.

hashCodeback to summary
public int hashCode()

Returns a hash code value for the object.

Returns:int

a hash code value for this object.

Annotations
@Override
isFrozenback to summary
public boolean isFrozen()

Returns true if this object has been frozen, false otherwise.

Returns:boolean

true if this object has been frozen, false otherwise

putAllback to summary
public void putAll(final ReadOnlyStringMap source)

Copies all key-value pairs from the specified ReadOnlyStringMap into this StringMap.

Parameters
source:ReadOnlyStringMap

the ReadOnlyStringMap to copy key-value pairs from

Exceptions
ConcurrentModificationException:
some implementations may not support structural modifications to this data structure while iterating over the contents with forEach(BiConsumer) or forEach(TriConsumer, Object).
UnsupportedOperationException:
if this collection has been frozen.
putValueback to summary
public void putValue(final String key, final Object value)

Puts the specified key-value pair into the collection.

Parameters
key:String

the key to add or remove. Keys may be null.

value:Object

the value to add. Values may be null.

Exceptions
ConcurrentModificationException:
some implementations may not support structural modifications to this data structure while iterating over the contents with forEach(BiConsumer) or forEach(TriConsumer, Object).
UnsupportedOperationException:
if this collection has been frozen.
removeback to summary
public void remove(final String key)

Removes the key-value pair for the specified key from this data structure.

Parameters
key:String

the key to remove. May be null.

Exceptions
ConcurrentModificationException:
some implementations may not support structural modifications to this data structure while iterating over the contents with forEach(BiConsumer) or forEach(TriConsumer, Object).
UnsupportedOperationException:
if this collection has been frozen.