public interface IValueMap extends Map<String,Object>
Map interface that holds values, parses Strings, and exposes a
variety of convenience methods.| Modifier and Type | Method and Description |
|---|---|
Boolean |
getAsBoolean(String key)
Retrieves a
Boolean value by key. |
boolean |
getAsBoolean(String key,
boolean defaultValue)
Retrieves a
boolean value by key. |
Double |
getAsDouble(String key)
Retrieves a
Double value by key. |
double |
getAsDouble(String key,
double defaultValue)
Retrieves a
double value by key. |
Duration |
getAsDuration(String key)
Retrieves a
Duration value by key. |
Duration |
getAsDuration(String key,
Duration defaultValue)
Retrieves a
Duration value by key. |
<T extends Enum<T>> |
getAsEnum(String key,
Class<T> eClass)
Retrieves an
Enum value by key. |
<T extends Enum<T>> |
getAsEnum(String key,
Class<T> eClass,
T defaultValue)
Retrieves an
Enum value by key. |
<T extends Enum<T>> |
getAsEnum(String key,
T defaultValue)
Retrieves an
Enum value by key. |
Integer |
getAsInteger(String key)
Retrieves an
Integer value by key. |
int |
getAsInteger(String key,
int defaultValue)
Retrieves an
integer value by key. |
Long |
getAsLong(String key)
Retrieves a
Long value by key. |
long |
getAsLong(String key,
long defaultValue)
Retrieves a
long value by key. |
Time |
getAsTime(String key)
Retrieves a
Time value by key. |
Time |
getAsTime(String key,
Time defaultValue)
Retrieves a
Time value by key. |
boolean |
getBoolean(String key)
Retrieves a
boolean value by key. |
CharSequence |
getCharSequence(String key)
Retrieves a
CharSequence by key. |
double |
getDouble(String key)
Retrieves a
double value by key. |
double |
getDouble(String key,
double defaultValue)
Retrieves a
double value by key, using a default value if not found. |
Duration |
getDuration(String key)
Retrieves a
Duration by key. |
int |
getInt(String key)
Retrieves an
int value by key. |
int |
getInt(String key,
int defaultValue)
Retrieves an
int value by key, using a default value if not found. |
String |
getKey(String key)
Provided that the hash key is a
String and you need to access the value ignoring
the key's case (upper- or lowercase letters), then you may use this method to get the correct
writing. |
long |
getLong(String key)
Retrieves a
long value by key. |
long |
getLong(String key,
long defaultValue)
Retrieves a
long value by key, using a default value if not found. |
String |
getString(String key)
Retrieves a
String by key. |
String |
getString(String key,
String defaultValue)
Retrieves a
String by key, using a default value if not found. |
String[] |
getStringArray(String key)
Retrieves a
String array by key. |
StringValue |
getStringValue(String key)
Retrieves a
StringValue object by key. |
Time |
getTime(String key)
Retrieves a
Time object by key. |
boolean |
isImmutable()
Returns whether or not this
IValueMap is immutable. |
IValueMap |
makeImmutable()
Makes this
IValueMap immutable by changing the underlying map representation to
a Collections.unmodifiableMap. |
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesboolean getBoolean(String key) throws StringValueConversionException
boolean value by key.key - the keyStringValueConversionExceptiondouble getDouble(String key) throws StringValueConversionException
double value by key.key - the keyStringValueConversionExceptiondouble getDouble(String key, double defaultValue) throws StringValueConversionException
double value by key, using a default value if not found.key - the keydefaultValue - value to use if no value is in this IValueMapStringValueConversionExceptionDuration getDuration(String key) throws StringValueConversionException
Duration by key.key - the keyDuration valueStringValueConversionExceptionint getInt(String key) throws StringValueConversionException
int value by key.key - the keyStringValueConversionExceptionint getInt(String key, int defaultValue) throws StringValueConversionException
int value by key, using a default value if not found.key - the keydefaultValue - value to use if no value is in this IValueMapStringValueConversionExceptionlong getLong(String key) throws StringValueConversionException
long value by key.key - the keyStringValueConversionExceptionlong getLong(String key, long defaultValue) throws StringValueConversionException
long value by key, using a default value if not found.key - the keydefaultValue - value to use if no value in this IValueMapStringValueConversionExceptionString getString(String key, String defaultValue)
String by key, using a default value if not found.key - the keydefaultValue - default value to return if value is nullStringString getString(String key)
String by key.key - the keyStringCharSequence getCharSequence(String key)
CharSequence by key.key - the keyCharSequenceString[] getStringArray(String key)
String array by key. If the value was a String[] it
will be returned directly. If it was a String it will be converted to a
String array of length one. If it was an array of another type, a
String array will be made and each element will be converted to a
String.key - the keyString array of that keyStringValue getStringValue(String key)
StringValue object by key.key - the keyStringValue objectTime getTime(String key) throws StringValueConversionException
Time object by key.key - the keyTime objectStringValueConversionExceptionboolean isImmutable()
IValueMap is immutable.IValueMap is immutableIValueMap makeImmutable()
IValueMap immutable by changing the underlying map representation to
a Collections.unmodifiableMap. After calling this method, any attempt to modify
this IValueMap will result in a RuntimeException being thrown by
the Collections framework.IValueMapString getKey(String key)
String and you need to access the value ignoring
the key's case (upper- or lowercase letters), then you may use this method to get the correct
writing.key - the keyBoolean getAsBoolean(String key)
Boolean value by key.key - the keyIValueMapboolean getAsBoolean(String key, boolean defaultValue)
boolean value by key.key - the keydefaultValue - the default to returnIValueMapInteger getAsInteger(String key)
Integer value by key.key - the keyIValueMapint getAsInteger(String key, int defaultValue)
integer value by key.key - the keydefaultValue - the default to returnIValueMapLong getAsLong(String key)
Long value by key.key - the keyIValueMaplong getAsLong(String key, long defaultValue)
long value by key.key - the keydefaultValue - the default to returnIValueMapDouble getAsDouble(String key)
Double value by key.key - the keyIValueMapdouble getAsDouble(String key, double defaultValue)
double value by key.key - the keydefaultValue - the default to returnIValueMapDuration getAsDuration(String key)
Duration value by key.key - the keyIValueMapDuration getAsDuration(String key, Duration defaultValue)
Duration value by key.key - the keydefaultValue - the default to returnIValueMapTime getAsTime(String key)
Time value by key.key - the keyIValueMapTime getAsTime(String key, Time defaultValue)
Time value by key.key - the keydefaultValue - the default to returnIValueMap<T extends Enum<T>> T getAsEnum(String key, Class<T> eClass)
Enum value by key.T - type of enumkey - the keyeClass - the enumeration classIValueMap<T extends Enum<T>> T getAsEnum(String key, T defaultValue)
Enum value by key.T - type of enumkey - the keydefaultValue - the default value from the Enumeration (cannot be null)IValueMap<T extends Enum<T>> T getAsEnum(String key, Class<T> eClass, T defaultValue)
Enum value by key.T - type of enumkey - the keyeClass - the enumeration classdefaultValue - the default value from the Enumeration (may be null)IValueMapCopyright © 2006–2020 Apache Software Foundation. All rights reserved.