get(String, Class) and get(String, Object) to make the return values type safe and/or auto-converted.
Also adds set(String, Object) for easier builder-style code.
Returns keys in alphabetical order.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | clear()
Implements java. Removes all of the mappings from this map (optional operation). |
| public boolean | containsKey(Object
key whose presence in this map is to be tested key)Implements java. Returns |
| public boolean | containsValue(Object
value whose presence in this map is to be tested value)Implements java. Returns |
| public Set | entrySet()
Implements java. Returns a |
| public boolean | equals(Object
object to be compared for equality with this map o)Overrides java. Implements java. Compares the specified object with this map for equality. |
| public Object | get(Object
the key whose associated value is to be returned key)Implements java. Returns the value to which the specified key is mapped,
or |
| public <T> T | |
| public <T> T | |
| public int | hashCode()
Overrides java. Implements java. Returns the hash code value for this map. |
| public boolean | |
| public Set | |
| public Object | put(String
key with which the specified value is to be associated key, Object value to be associated with the specified key value)Implements java. Like normal |
| public void | putAll(Map<? extends String, ?>
mappings to be stored in this map m)Implements java. Copies all of the mappings from the specified map to this map (optional operation). |
| public Object | remove(Object
key whose mapping is to be removed from the map key)Implements java. Removes the mapping for a key from this map if it is present (optional operation). |
| public SmartMap | set(String key, Object value)
Works like |
| public int | |
| public Collection | values()
Implements java. Returns a |
| values | back to summary |
|---|---|
| private final SortedMap<String, Object> values | |
| SmartMap | back to summary |
|---|---|
| public SmartMap() | |
| clear | back to summary |
|---|---|
| public void clear() Implements java. Doc from java. Removes all of the mappings from this map (optional operation). The map will be empty after this call returns.
| |
| containsKey | back to summary |
|---|---|
| public boolean containsKey(Object key) Implements java. Doc from java. Returns | |
| containsValue | back to summary |
|---|---|
| public boolean containsValue(Object value) Implements java. Doc from java. Returns | |
| entrySet | back to summary |
|---|---|
| public Set Implements java. Doc from java. Returns a | |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Implements java. Doc from java. Compares the specified object with this map for equality. Returns
| |
| get | back to summary |
|---|---|
| public Object get(Object key) Implements java. Doc from java. Returns the value to which the specified key is mapped,
or More formally, if this map contains a mapping from a key
If this map permits null values, then a return value of
| |
| get | back to summary |
|---|---|
| public <T> T get(String key, Class<T> type) Return the value for the given key converted to the passed type. If the value associated with the key is null, null is returned.
If the stored value is different than the passed type, a conversion is attempted using | |
| get | back to summary |
|---|---|
| public <T> T get(String key, T defaultValue) Return the value for the given key converted to the type of the default value.
If the value is null, defaultValue is returned.
Conversion is done using | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Implements java. Doc from java. Returns the hash code value for this map. The hash code of a map is
defined to be the sum of the hash codes of each entry in the map's
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Implements java. Doc from java. Returns
| |
| keySet | back to summary |
|---|---|
| public Set Implements java. Doc from java. Returns a | |
| put | back to summary |
|---|---|
| public Object put(String key, Object value) Implements java. Like normal
| |
| putAll | back to summary |
|---|---|
| public void putAll(Map<? extends String, ?> m) Implements java. Doc from java. Copies all of the mappings from the specified map to this map
(optional operation). The effect of this call is equivalent to that
of calling | |
| remove | back to summary |
|---|---|
| public Object remove(Object key) Implements java. Doc from java. Removes the mapping for a key from this map if it is present
(optional operation). More formally, if this map contains a mapping
from key Returns the value to which this map previously associated the key,
or If this map permits null values, then a return value of
The map will not contain a mapping for the specified key once the call returns. | |
| set | back to summary |
|---|---|
| public SmartMap set(String key, Object value) Works like | |
| size | back to summary |
|---|---|
| public int size() Implements java. Doc from java. Returns the number of key-value mappings in this map. If the
map contains more than
| |
| values | back to summary |
|---|---|
| public Collection Implements java. Doc from java. Returns a
| |