public abstract class AbstractMapDecorator extends Object implements Map
Methods are forwarded directly to the decorated map.
This implementation does not perform any special processing with
entrySet()
, keySet()
or values()
. Instead
it simply returns the set/collection from the wrapped map. This may be
undesirable, for example if you are trying to write a validating
implementation it would provide a loophole around the validation.
But, you might want that loophole, so this class is kept simple.
Modifier | Constructor and Description |
---|---|
protected |
AbstractMapDecorator()
Constructor only used in deserialization, do not use otherwise.
|
|
AbstractMapDecorator(Map map)
Constructor that wraps (not copies).
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set |
entrySet() |
boolean |
equals(Object object) |
Object |
get(Object key) |
protected Map |
getMap()
Gets the map being decorated.
|
int |
hashCode() |
boolean |
isEmpty() |
Set |
keySet() |
Object |
put(Object key,
Object value) |
void |
putAll(Map mapToCopy) |
Object |
remove(Object key) |
int |
size() |
String |
toString() |
Collection |
values() |
protected transient Map map
protected AbstractMapDecorator()
public AbstractMapDecorator(Map map)
map
- the map to decorate, must not be nullIllegalArgumentException
- if the collection is nullprotected Map getMap()
public boolean containsKey(Object key)
containsKey
in interface Map
public boolean containsValue(Object value)
containsValue
in interface Map
public Collection values()
public boolean equals(Object object)
public int hashCode()
Copyright © 2001–2015 The Apache Software Foundation. All rights reserved.