public final class PropertyMap extends BaseTypesMap<String,Object> implements Cloneable, Serializable
Provides convenient type conversion get methods that take default values.
NOTE: keys are treated as case insensitive.
BaseTypesMap.BaseTypesEntry
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
PropertyMap() |
PropertyMap(int initialCapacity) |
PropertyMap(Map<? extends String,? extends Object> m) |
Modifier and Type | Method and Description |
---|---|
PropertyMap |
clone()
Performs a deep clone of this map.
|
boolean |
containsKey(Object key) |
static boolean |
get(Map<String,?> map,
String key,
boolean defaultValue)
Get a boolean value from
map for key returning
defaultValue if key is not found. |
static double |
get(Map<String,?> map,
String key,
double defaultValue)
Get a double value from
map for key returning
defaultValue if key is not found. |
static float |
get(Map<String,?> map,
String key,
float defaultValue)
Get a float value from
map for key returning
defaultValue if key is not found. |
static int |
get(Map<String,?> map,
String key,
int defaultValue)
Get an int value from
map for key returning
defaultValue if key is not found. |
static long |
get(Map<String,?> map,
String key,
long defaultValue)
Get a long value from
map for key returning
defaultValue if key is not found. |
static Object |
get(Map<String,?> map,
String key,
Object defaultValue)
Get an Object value from
map for key returning
defaultValue if key is not found. |
static String |
get(Map<String,?> map,
String key,
String defaultValue)
Get a String value from
map for key returning
defaultValue if key is not found. |
Object |
get(Object key) |
boolean |
get(String key,
boolean defaultValue)
Get a boolean value for
key . |
double |
get(String key,
double defaultValue)
Get a double value for
key . |
float |
get(String key,
float defaultValue)
Get a float value for
key . |
int |
get(String key,
int defaultValue)
Get an int value for
key . |
long |
get(String key,
long defaultValue)
Get a long value for
key . |
Object |
get(String key,
Object defaultValue)
Get an Object value for
key . |
String |
get(String key,
String defaultValue)
Get a String value for
key . |
String |
prettyFormat()
Pretty format this PropertyMap.
|
void |
prettyFormat(StringBuilder buffer,
int indent)
Pretty format this PropertyMap.
|
void |
prettyFormat(StringBuilder buffer,
int indent,
Set<String> exclude)
Pretty format this PropertyMap.
|
Object |
put(String key,
Object value) |
void |
putAll(Map<? extends String,? extends Object> m) |
void |
putAll(Map<String,?> map,
boolean override)
Put all entries from map into this property map.
|
checkType, getEntries, setEntries
clear, containsValue, entrySet, forEach, getOrDefault, keySet, removeEldestEntry, replaceAll, values
compute, computeIfAbsent, computeIfPresent, isEmpty, merge, putIfAbsent, remove, remove, replace, replace, size
equals, hashCode, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, equals, hashCode, isEmpty, merge, putIfAbsent, remove, remove, replace, replace, size
public PropertyMap()
public PropertyMap(int initialCapacity)
public boolean get(String key, boolean defaultValue)
key
.public int get(String key, int defaultValue)
key
.public long get(String key, long defaultValue)
key
.public float get(String key, float defaultValue)
key
.public double get(String key, double defaultValue)
key
.public static boolean get(Map<String,?> map, String key, boolean defaultValue)
map
for key
returning
defaultValue
if key
is not found.public static int get(Map<String,?> map, String key, int defaultValue)
map
for key
returning
defaultValue
if key
is not found.public static long get(Map<String,?> map, String key, long defaultValue)
map
for key
returning
defaultValue
if key
is not found.public static float get(Map<String,?> map, String key, float defaultValue)
map
for key
returning
defaultValue
if key
is not found.public static double get(Map<String,?> map, String key, double defaultValue)
map
for key
returning
defaultValue
if key
is not found.public static String get(Map<String,?> map, String key, String defaultValue)
map
for key
returning
defaultValue
if key
is not found.public static Object get(Map<String,?> map, String key, Object defaultValue)
map
for key
returning
defaultValue
if key
is not found.public String prettyFormat()
public void prettyFormat(StringBuilder buffer, int indent)
buffer
- buffer to write pretty formated representation to.indent
- the indentation levelpublic void prettyFormat(StringBuilder buffer, int indent, Set<String> exclude)
buffer
- buffer to write pretty formated representation to.indent
- the indentation levelexclude
- the parameters to not formatpublic void putAll(Map<String,?> map, boolean override)
If override
is false, values specified in map
will not
override values in this property map if they share a key.
public PropertyMap clone()
BaseTypesMap
clone
in class BaseTypesMap<String,Object>
public boolean containsKey(Object key)
containsKey
in interface Map<String,Object>
containsKey
in class HashMap<String,Object>
Copyright © 2018 Attivio, Inc. All Rights Reserved.
PATENT NOTICE: Attivio, Inc. Software Related Patents. With respect to the Attivio software product(s) being used, the following patents apply: Querying Joined Data Within A Search Engine Index: United States Patent No.(s): 8,073,840. Ordered Processing of Groups of Messages: U.S. Patent No.(s) 8,495,656. Signal processing approach to sentiment analysis for entities in documents: U.S. Patent No.(s) 8,725,494. Other U.S. and International Patents Pending.