public interface ReadOnlyStringMap extends Serializable
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(String key)
Returns
true if this data structure contains the specified key, false otherwise. |
<V> void |
forEach(BiConsumer<String,? super V> action)
Performs the given action for each key-value pair in this data structure
until all entries have been processed or the action throws an exception.
|
<V,S> void |
forEach(TriConsumer<String,? super V,S> action,
S state)
Performs the given action for each key-value pair in this data structure
until all entries have been processed or the action throws an exception.
|
<V> V |
getValue(String key)
Returns the value for the specified key, or
null if the specified key does not exist in this collection. |
boolean |
isEmpty()
Returns
true if this collection is empty (size is zero), false otherwise. |
int |
size()
Returns the number of key-value pairs in this collection.
|
Map<String,String> |
toMap()
Returns a non-
null mutable Map<String, String> containing a snapshot of this data structure. |
Map<String,String> toMap()
null
mutable Map<String, String>
containing a snapshot of this data structure.Map<String, String>
form.boolean containsKey(String key)
true
if this data structure contains the specified key, false
otherwise.key
- the key whose presence to check. May be null
.true
if this data structure contains the specified key, false
otherwise.<V> void forEach(BiConsumer<String,? super V> action)
Some implementations may not support structural modifications (adding new elements or removing elements) while
iterating over the contents. In such implementations, attempts to add or remove elements from the
BiConsumer
's BiConsumer.accept(Object, Object)
accept} method may cause a
ConcurrentModificationException
to be thrown.
V
- type of the value.action
- The action to be performed for each key-value pair in this collection.ConcurrentModificationException
- some implementations may not support structural modifications
to this data structure while iterating over the contents with forEach(BiConsumer)
or
forEach(TriConsumer, Object)
.<V,S> void forEach(TriConsumer<String,? super V,S> action, S state)
The third parameter lets callers pass in a stateful object to be modified with the key-value pairs, so the TriConsumer implementation itself can be stateless and potentially reusable.
Some implementations may not support structural modifications (adding new elements or removing elements) while
iterating over the contents. In such implementations, attempts to add or remove elements from the
TriConsumer
's accept
method may cause a
ConcurrentModificationException
to be thrown.
V
- type of the value.S
- type of the third parameter.action
- The action to be performed for each key-value pair in this collection.state
- the object to be passed as the third parameter to each invocation on the specified
triconsumer.ConcurrentModificationException
- some implementations may not support structural modifications
to this data structure while iterating over the contents with forEach(BiConsumer)
or
forEach(TriConsumer, Object)
.<V> V getValue(String key)
null
if the specified key does not exist in this collection.key
- the key whose value to return.null
.boolean isEmpty()
true
if this collection is empty (size is zero), false
otherwise.true
if this collection is empty (size is zero).int size()
Copyright © 1999-1969 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.