public class ObjectUtil extends Object
| 构造器和说明 |
|---|
ObjectUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static Object |
clone(Object source)
Clone an object by invoking it's
clone() method, even if it
is not overridden. |
static boolean |
containsElement(Object obj,
Object element)
Returns true if first argument contains provided element. s
|
static boolean |
equals(Object obj1,
Object obj2)
Safely compares two objects just like
equals() would, except
it allows any of the 2 objects to be null. |
static boolean |
equalsEx(Object obj1,
Object obj2)
Compares two objects or two object arrays.
|
static boolean |
equalsType(Object object,
Object thiz)
Non-symmetric utility for comparing the types of two objects.
|
static <T> T |
getNotNullObject(Class<T> c,
T t)
Description:
如前传入的对象t为null,则通过返映实例货传入的类型实例 |
static int |
length(Object obj)
Returns length of the object.
|
public static <T> T getNotNullObject(Class<T> c, T t)
c - t - public static boolean equals(Object obj1, Object obj2)
equals() would, except
it allows any of the 2 objects to be null.true if arguments are equal, otherwise
falsepublic static boolean equalsEx(Object obj1, Object obj2)
Object.equals(Object).public static boolean equalsType(Object object, Object thiz)
Object.equals(Object) if instanceof is
not used.object - equals() argumentthiz - current class that overrides equals()public static Object clone(Object source) throws CloneNotSupportedException
clone() method, even if it
is not overridden.public static int length(Object obj)
Copyright © 2016. All rights reserved.