public class JSUtils
extends java.lang.Object
ScriptObjectMirror
Constructor and Description |
---|
JSUtils() |
Modifier and Type | Method and Description |
---|---|
static <T> T |
castSafely(java.lang.Object obj,
java.lang.Class<T> objClass,
boolean allowEmpty)
Attempt to safely cast the given object into a given class.
|
static <T> boolean |
checkSafety(java.lang.Object obj,
java.lang.Class<T> objClass,
boolean allowEmpty)
Test whether a given object can be safely cast into a given class.
|
static <T> boolean |
isSafe(java.lang.Object obj,
java.lang.Class<T> objClass)
Test whether a given object can be safely cast into a given class.
|
static <T> boolean |
isSafeNotEmpty(java.lang.Object obj,
java.lang.Class<T> objClass)
Test whether a given object can be safely cast into a given class.
|
public static <T> T castSafely(java.lang.Object obj, java.lang.Class<T> objClass, boolean allowEmpty)
obj
- The object to be cast.objClass
- The class to cast the object to.allowEmpty
- Whether empty objects are desired.public static <T> boolean isSafe(java.lang.Object obj, java.lang.Class<T> objClass)
obj
- The object to be cast.objClass
- The class to cast the object to.public static <T> boolean isSafeNotEmpty(java.lang.Object obj, java.lang.Class<T> objClass)
obj
- The object to be cast.objClass
- The class to cast the object to.public static <T> boolean checkSafety(java.lang.Object obj, java.lang.Class<T> objClass, boolean allowEmpty)
obj
- The object to be cast.objClass
- The class to cast the object to.allowEmpty
- Whether empty objects are desired.