public class AnyUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static AnyMap |
EMPTY_MAP
Immutable empty AnyMap instance.
|
| Modifier | Constructor and Description |
|---|---|
protected |
AnyUtil()
prevent instance creation.
|
| Modifier and Type | Method and Description |
|---|---|
static Object |
anyToNative(Any any)
Converts an Any object into a native java object.
|
static Properties |
anyToProperties(AnyMap anyMap)
convert AnyMap to java.util.Properties.
|
static Boolean |
asBoolean(Any any)
null save version.
|
static Date |
asDate(Any any)
null save version.
|
static Date |
asDateTime(Any any)
null save version.
|
static Double |
asDouble(Any any)
null save version.
|
static Long |
asLong(Any any)
null save version.
|
static AnyMap |
asMap(Any any)
null save version.
|
static AnySeq |
asSeq(Any any)
null save version.
|
static String |
asString(Any any)
null save version.
|
static AnyMap |
exceptionToAny(Throwable e)
convert an exception to an any object.
|
static AnyMap |
findMapInSeq(AnySeq seq,
String keyName,
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(Object object)
Converts an object to an Any (recursively).
|
static AnyMap |
propertiesToAny(Properties props)
convert java.util.Properties to AnyMap.
|
static Any |
saveGet(Any any,
String[] path)
get value for given path(list of keys) from AnyMap object.
|
public static final AnyMap EMPTY_MAP
public static Object anyToNative(Any any)
any - the Any objectpublic static Any objectToAny(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, String[] path)
any - the Any object.path - path to the entry.public static AnyMap exceptionToAny(Throwable e)
e - exception to convertpublic static Properties anyToProperties(AnyMap anyMap)
public static AnyMap propertiesToAny(Properties props)
Copyright © 2019. All rights reserved.