|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnl.knowledgeplaza.util.ObjectUtil
public class ObjectUtil
| Field Summary | |
|---|---|
static String |
SOURCECODE_VERSION
Standard variable for determining version of a class file. |
| Constructor Summary | |
|---|---|
ObjectUtil()
|
|
| Method Summary | |
|---|---|
static byte |
byteValue(Object o)
|
static Object |
callMethod(Object object,
String methodName)
Call method with no parameters |
static Object |
callMethod(Object object,
String methodName,
Class[] parameterTypes,
Object[] parameterValues)
Call a method |
static int |
compareTo(Comparable o1,
Comparable o2)
Does a o1.compareTo(o2) but also checks if o1 or o2 are null. |
static Object |
deepClone(Object orig)
Returns a copy of the object |
static Object |
deepCloneReflection(Object obj)
Makes a reflection-based deep clone of 'obj'. |
static Object |
deepCloneSerialisation(Object orig)
Returns a copy of the object, or null if the object cannot be serialized. |
static double |
doubleValue(Object o)
|
static boolean |
equals(Object o1,
Object o2)
Does a o1.equals(o2) but also checks if o1 or o2 are null. |
static double |
floatValue(Object o)
|
static Method |
getMethod(Object object,
String methodName,
Class[] parameterTypes)
Determine if object has a method |
static boolean |
hasMethod(Object object,
String methodName)
Determine if object has a method |
static boolean |
hasMethod(Object object,
String methodName,
Class[] parameterTypes)
Determine if object has a method |
static Object |
ifNull(Object s,
Object n)
|
static int |
intValue(Object o)
|
static long |
longValue(Object o)
|
static short |
shortValue(Object o)
|
static Object |
stripProxies(Object o)
Strip the proxies from an object, so the actual object is returned. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String SOURCECODE_VERSION
| Constructor Detail |
|---|
public ObjectUtil()
| Method Detail |
|---|
public static Object deepClone(Object orig)
public static Object deepCloneSerialisation(Object orig)
public static Object deepCloneReflection(Object obj)
obj - input object to clone [null will cause a NullPointerException]
RuntimeException - on any failurepublic static byte byteValue(Object o)
public static short shortValue(Object o)
public static int intValue(Object o)
public static long longValue(Object o)
public static double doubleValue(Object o)
public static double floatValue(Object o)
public static Object ifNull(Object s,
Object n)
s -
public static Method getMethod(Object object,
String methodName,
Class[] parameterTypes)
object - methodName - parameterTypes -
public static boolean hasMethod(Object object,
String methodName,
Class[] parameterTypes)
object - methodName - parameterTypes -
public static boolean hasMethod(Object object,
String methodName)
object - methodName - TODO: caching
public static Object callMethod(Object object,
String methodName,
Class[] parameterTypes,
Object[] parameterValues)
object - methodName - parameterTypes - parameterValues -
public static Object callMethod(Object object,
String methodName)
object - methodName -
public static boolean equals(Object o1,
Object o2)
o1 - o2 -
public static int compareTo(Comparable o1,
Comparable o2)
o1 - o2 -
public static Object stripProxies(Object o)
o -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||