|
SMILA 1.0 API documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.smila.datamodel.util.AnyUtil
public final class AnyUtil
utility class for handling / conversion of Any objects. Hint: The Any-to-JSON conversion for Date(Time)s is not symmetric. If the Any object contains Date(Time) values, they will be serialized to String values in simple timestamp format. But when parsing JSON to an Any object, Date(Time) strings will not be recognized anymore, but just read as String values.
| Field Summary | |
|---|---|
static AnyMap |
EMPTY_MAP
Immutable empty AnyMap instance. |
| Method Summary | |
|---|---|
static java.lang.Object |
anyToNative(Any any)
Converts an Any object into a native java object. |
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 Any |
objectToAny(java.lang.Object object)
Converts an object to an Any (recursively). |
static Any |
saveGet(Any any,
java.lang.String[] path)
get value for given path(list of keys) from AnyMap object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final AnyMap EMPTY_MAP
| Method Detail |
|---|
public static java.lang.Object anyToNative(Any any)
any - the Any object
public 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 convert
public 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 AnyMap asMap(Any any)
public static AnySeq asSeq(Any any)
|
SMILA 1.0 API documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||