public class ValueMapDecorator extends java.lang.Object implements ValueMap
ValueMapDecorator
decorates another Map
to provide a basic implementation for the additional methods
of a ValueMap
.Constructor and Description |
---|
ValueMapDecorator(java.util.Map<java.lang.String,java.lang.Object> base)
Creates a new wrapper around a given map.
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> |
entrySet() |
boolean |
equals(java.lang.Object obj) |
java.lang.Object |
get(java.lang.Object key) |
<T> T |
get(@NotNull java.lang.String name,
@NotNull java.lang.Class<T> type)
Get a named property and convert it into the given type.
|
<T> T |
get(@NotNull java.lang.String name,
T defaultValue)
Get a named property and convert it into the given type.
|
int |
hashCode() |
boolean |
isEmpty() |
java.util.Set<java.lang.String> |
keySet() |
java.lang.Object |
put(java.lang.String key,
java.lang.Object value) |
void |
putAll(java.util.Map<? extends java.lang.String,?> t) |
java.lang.Object |
remove(java.lang.Object key) |
int |
size() |
java.lang.String |
toString() |
java.util.Collection<java.lang.Object> |
values() |
public ValueMapDecorator(java.util.Map<java.lang.String,java.lang.Object> base)
base
- wrapped objectpublic <T> T get(@NotNull @NotNull java.lang.String name, @NotNull @NotNull java.lang.Class<T> type)
null
in this
case.@NotNull public <T> T get(@NotNull @NotNull java.lang.String name, @NotNull T defaultValue)
null
.
Therefore all implementations should internally call Map.get(Object)
when the 2nd parameter
has value null
.get
in interface ValueMap
T
- The expected typename
- The name of the propertydefaultValue
- The default value to use if the named property does
not exist or cannot be converted to the requested type. The
default value is also used to define the type to convert the
value to. Must not be null
. If you want to return null
by default
rather rely on ValueMap.get(String, Class)
.public int size()
size
in interface java.util.Map<java.lang.String,java.lang.Object>
public boolean isEmpty()
isEmpty
in interface java.util.Map<java.lang.String,java.lang.Object>
public boolean containsKey(java.lang.Object key)
containsKey
in interface java.util.Map<java.lang.String,java.lang.Object>
public boolean containsValue(java.lang.Object value)
containsValue
in interface java.util.Map<java.lang.String,java.lang.Object>
public java.lang.Object get(java.lang.Object key)
get
in interface java.util.Map<java.lang.String,java.lang.Object>
public java.lang.Object put(java.lang.String key, java.lang.Object value)
put
in interface java.util.Map<java.lang.String,java.lang.Object>
public java.lang.Object remove(java.lang.Object key)
remove
in interface java.util.Map<java.lang.String,java.lang.Object>
public void putAll(java.util.Map<? extends java.lang.String,?> t)
putAll
in interface java.util.Map<java.lang.String,java.lang.Object>
public void clear()
clear
in interface java.util.Map<java.lang.String,java.lang.Object>
public java.util.Set<java.lang.String> keySet()
keySet
in interface java.util.Map<java.lang.String,java.lang.Object>
public java.util.Collection<java.lang.Object> values()
values
in interface java.util.Map<java.lang.String,java.lang.Object>
public java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> entrySet()
entrySet
in interface java.util.Map<java.lang.String,java.lang.Object>
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in interface java.util.Map<java.lang.String,java.lang.Object>
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in interface java.util.Map<java.lang.String,java.lang.Object>
equals
in class java.lang.Object
Copyright © 2022 The Apache Software Foundation. All rights reserved.