AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Constructor and Description |
|---|
BeanMap(Object bean)
Construct a BeanMap instance by wrapping an Object which follows Java Bean spec.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsKey(Object key)
Returns true if this map contains a mapping for the specified
key.
|
Set<Map.Entry<String,Object>> |
entrySet()
Returns a
Set view of the mappings contained in this map. |
Object |
get(Object key)
Returns the value to which the specified key is mapped,
or
null if this map contains no mapping for the key. |
Object |
put(String key,
Object value)
Associates the specified value with the specified key in this map
(optional operation).
|
int |
size()
Returns the number of key-value mappings in this map.
|
clear, containsValue, equals, hashCode, isEmpty, keySet, putAll, remove, toString, valuescompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAllpublic BeanMap(Object bean)
bean - Object with setters and getters to access propertiespublic Object get(Object key)
null if this map contains no mapping for the key.
More formally, if this map contains a mapping from a key
k to a value v such that (key==null ? k==null :
key.equals(k)), then this method returns v; otherwise
it returns null. (There can be at most one such mapping.)
If this map permits null values, then a return value of
null does not necessarily indicate that the map
contains no mapping for the key; it's also possible that the map
explicitly maps the key to null. The containsKey operation may be used to distinguish these two cases.
get in interface Map<String,Object>get in class AbstractMap<String,Object>key - the key whose associated value is to be returnednull if this map contains no mapping for the keyClassCastException - if the key is of an inappropriate type for
this map (optional)NullPointerException - if the specified key is null and this map
does not permit null keys (optional)public Object put(String key, Object value)
m.containsKey(k) would return
true.)put in interface Map<String,Object>put in class AbstractMap<String,Object>key - key with which the specified value is to be associatedvalue - value to be associated with the specified keyUnsupportedOperationException - if the put operation
is not supported by this mapClassCastException - if the class of the specified key or value
prevents it from being stored in this mapNullPointerException - if the specified key or value is null
and this map does not permit null keys or valuesIllegalArgumentException - if some property of the specified key
or value prevents it from being stored in this mappublic Set<Map.Entry<String,Object>> entrySet()
Set view of the mappings contained in this map.
The set is backed by the map, so changes to the map are
reflected in the set, and vice-versa. If the map is modified
while an iteration over the set is in progress (except through
the iterator's own remove operation, or through the
setValue operation on a map entry returned by the
iterator) the results of the iteration are undefined. The set
supports element removal, which removes the corresponding
mapping from the map, via the Iterator.remove,
Set.remove, removeAll, retainAll and
clear operations. It does not support the
add or addAll operations.public int size()
public boolean containsKey(Object key)
containsKey in interface Map<String,Object>containsKey in class AbstractMap<String,Object>key - key whose presence in this map is to be testedClassCastException - if the key is of an inappropriate type for
this map (optional)NullPointerException - if the specified key is null and this map
does not permit null keys (optional)This documentation is licensed by Andrew Bowley under the GPLv3 License.