public class ObjectUtils
extends java.lang.Object
Constructor and Description |
---|
ObjectUtils() |
Modifier and Type | Method and Description |
---|---|
static <T> int |
compare(java.lang.Comparable<T> o1,
T o2)
Compare two object.
|
static boolean |
equal(java.lang.Object obj1,
java.lang.Object obj2)
Check if two object is equal.
|
protected static int |
getInt(byte[] bytes) |
static java.lang.String |
guid() |
static java.lang.String |
guid(java.lang.Object obj)
Genrate global unique identifier for
obj . |
protected static java.lang.String |
hex(int value) |
static <K> K |
nvl(K... objs)
Return the first object which is not null.
|
protected static int getInt(byte[] bytes)
protected static java.lang.String hex(int value)
public static java.lang.String guid()
public static java.lang.String guid(java.lang.Object obj)
obj
.obj
- object to use for generationpublic static boolean equal(java.lang.Object obj1, java.lang.Object obj2)
obj1
- first object to compareobj2
- second object to comparepublic static <T> int compare(java.lang.Comparable<T> o1, T o2)
T
- object typeo1
- first object to compareo2
- second object to compreComparable
public static <K> K nvl(K... objs)
Return null
, if @{code objs} is null
Return null
, if all elements
in @{code objs} are null
K
- object typeobjs
- object array to check