public final class AnyUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static AnyMap |
EMPTY_MAP
Immutable empty AnyMap instance.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.Object |
anyToNative(Any any)
Converts an Any object into a native java object.
|
static java.util.Properties |
anyToProperties(AnyMap anyMap)
convert AnyMap to java.util.Properties.
|
static java.lang.Boolean |
asBoolean(Any any)
null save version.
|
static java.util.Date |
asDate(Any any)
null save version.
|
static java.util.Date |
asDateTime(Any any)
null save version.
|
static java.lang.Double |
asDouble(Any any)
null save version.
|
static java.lang.Long |
asLong(Any any)
null save version.
|
static AnyMap |
asMap(Any any)
null save version.
|
static AnySeq |
asSeq(Any any)
null save version.
|
static java.lang.String |
asString(Any any)
null save version.
|
static AnyMap |
exceptionToAny(java.lang.Throwable e)
convert an exception to an any object.
|
static AnyMap |
findMapInSeq(AnySeq seq,
java.lang.String keyName,
java.lang.String keyValue)
returns the 1st map in the give SEQ that contains a value with the given name value, or null if not found.
|
static Any |
objectToAny(java.lang.Object object)
Converts an object to an Any (recursively).
|
static AnyMap |
propertiesToAny(java.util.Properties props)
convert java.util.Properties to AnyMap.
|
static Any |
saveGet(Any any,
java.lang.String[] path)
get value for given path(list of keys) from AnyMap object.
|
public static final AnyMap EMPTY_MAP
public static java.lang.Object anyToNative(Any any)
any
- the Any objectpublic static Any objectToAny(java.lang.Object object)
DataFactory.autoConvertValue(Object)
.object
- The object to be converted. Supported (and tested in this order) are
Map<String, Object>
Collections<Object>
Object[]
DataFactory.autoConvertValue(Object)
public static Any saveGet(Any any, java.lang.String[] path)
any
- the Any object.path
- path to the entry.public static AnyMap exceptionToAny(java.lang.Throwable e)
e
- exception to convertpublic static java.lang.Double asDouble(Any any)
public static java.lang.Boolean asBoolean(Any any)
public static java.util.Date asDateTime(Any any)
public static java.util.Date asDate(Any any)
public static java.lang.Long asLong(Any any)
public static java.lang.String asString(Any any)
public static java.util.Properties anyToProperties(AnyMap anyMap)
public static AnyMap propertiesToAny(java.util.Properties props)
public static AnyMap findMapInSeq(AnySeq seq, java.lang.String keyName, java.lang.String keyValue)