public final class DuelData extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> List<T> |
asList(T... items)
Builds a mutable List from a sequence of items
|
static Map<String,Object> |
asMap(Object... pairs)
Builds a mutable Map from an interlaced sequence of key-value pairs
|
static boolean |
coerceBoolean(Object data)
Coerces any Object to a JS-style Boolean
|
static Collection<?> |
coerceCollection(Object data)
Coerces any Object to a JS-style Array (List)
|
static Map<?,?> |
coerceMap(Object data)
Coerces any Object to a JS-style Object (Map)
|
static double |
coerceNumber(Object data)
Coerces any Object to a JS-style Number (double)
|
static String |
coerceString(Object data)
Coerces any Object to a JS-style String
|
static boolean |
containsKey(Object data,
Object key)
Treats the object as a Map and calls containsKey
|
static boolean |
isArray(Class<?> exprType) |
static boolean |
isBoolean(Class<?> exprType) |
static boolean |
isDate(Class<?> exprType) |
static boolean |
isNumber(Class<?> exprType) |
static boolean |
isPrimitive(Class<?> dataType) |
static boolean |
isString(Class<?> exprType) |
static String |
typeOf(Object data)
Simulates the typeof operator
|
public static Map<String,Object> asMap(Object... pairs)
pairs - public static <T> List<T> asList(T... items)
items - public static boolean isPrimitive(Class<?> dataType)
public static boolean isBoolean(Class<?> exprType)
public static boolean isNumber(Class<?> exprType)
public static boolean isString(Class<?> exprType)
public static boolean isArray(Class<?> exprType)
public static boolean isDate(Class<?> exprType)
public static String typeOf(Object data)
data - public static boolean coerceBoolean(Object data)
data - public static double coerceNumber(Object data)
data - public static String coerceString(Object data)
data - public static Collection<?> coerceCollection(Object data)
data - public static Map<?,?> coerceMap(Object data)
data - Copyright © 2014. All rights reserved.