public abstract class ObjectUtil
extends java.lang.Object
| 限定符和类型 | 方法和说明 |
|---|---|
static <V> int |
compare(V v1,
V v2)
compare two object
About result
if v1 > v2, return 1
if v1 = v2, return 0
if v1 < v2, return -1
About rule
if v1 is null, v2 is null, then return 0
if v1 is null, v2 is not null, then return -1
if v1 is not null, v2 is null, then return 1
return v1.
|
static boolean |
isEquals(java.lang.Object actual,
java.lang.Object expected)
compare two object
|
static java.lang.String |
nullStrToEmpty(java.lang.Object str)
null Object to empty string
nullStrToEmpty(null) = "";
nullStrToEmpty("") = "";
nullStrToEmpty("aa") = "aa";
|
static java.lang.Integer[] |
transformIntArray(int[] source)
convert int array to Integer array
|
static int[] |
transformIntArray(java.lang.Integer[] source)
convert Integer array to int array
|
static java.lang.Long[] |
transformLongArray(long[] source)
convert long array to Long array
|
static long[] |
transformLongArray(java.lang.Long[] source)
convert Long array to long array
|
public static boolean isEquals(java.lang.Object actual,
java.lang.Object expected)
actual - expected - Object.equals(Object)public static java.lang.String nullStrToEmpty(java.lang.Object str)
nullStrToEmpty(null) = "";
nullStrToEmpty("") = "";
nullStrToEmpty("aa") = "aa";
str - public static java.lang.Long[] transformLongArray(long[] source)
source - public static long[] transformLongArray(java.lang.Long[] source)
source - public static java.lang.Integer[] transformIntArray(int[] source)
source - public static int[] transformIntArray(java.lang.Integer[] source)
source - public static <V> int compare(V v1,
V v2)
Comparable.compareTo(Object)v1 - v2 -