public abstract class GeneralAlgorithm extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static Object |
addTwoObject(Object a,
Object b) |
static Object |
addTwoObject(Object a,
Object b,
boolean nullSensitive)
将两个对象加+起来,可能是数字相加,也可能是字符串连接
|
static boolean |
betweenTwoObject(Object operand,
Object obj1,
Object obj2) |
static Object |
castObjectToType(Object obj,
Class<?> type) |
static <T extends Comparable<? super T>> |
compareTwoComparableObject(T l1,
T l2) |
static <T extends Comparable<? super T>> |
compareTwoComparableObject(T l1,
T l2,
boolean nullAsFirst)
int compare(final T c1, final T c2)
等价于 ObjectUtils.compare
|
static int |
compareTwoObject(Object operand,
Object operand2) |
static int |
compareTwoObject(Object operand,
Object operand2,
boolean nullAsFirst) |
static int |
compareTwoObjectByField(Object data1,
Object data2,
String[] fields,
boolean nullAsFirst) |
static <T,U extends Comparable<? super U>> |
comparing(Function<? super T,? extends U> keyExtractor,
boolean nullAsFirst) |
static Object |
divideTwoObject(Object a,
Object b) |
static boolean |
equals(Object operand,
Object operand2) |
static boolean |
equals(Object operand,
Object operand2,
boolean allNullAsTrue)
return (a == b) or (a !
|
static boolean |
isEmpty(Object obj)
功能:判断对象是否为空 类似于 CollectionUtils.isEmpty(Object obj)
|
static Object |
maxObject(Collection<Object> ar) |
static Object |
minObject(Collection<Object> ar) |
static Object |
modTwoObject(Object a,
Object b) |
static Object |
multiplyTwoObject(Object a,
Object b) |
static <T> T |
nvl(T obj,
T obj2) |
static <T> T |
nvl2(Object obj,
T obj2,
T obj3) |
static Object |
subtractTwoObject(Object a,
Object b) |
static Object |
sumObjects(Collection<Object> ar) |
public static <T> T nvl(T obj,
T obj2)
public static <T> T nvl2(Object obj, T obj2, T obj3)
public static boolean equals(Object operand, Object operand2, boolean allNullAsTrue)
operand - an objectoperand2 - an object to be compared with a for equalityallNullAsTrue - 两个参数都是null时返回 truetrue if the arguments are equal to each other
and false otherwiseequalspublic static int compareTwoObject(Object operand, Object operand2, boolean nullAsFirst)
public static int compareTwoObjectByField(Object data1, Object data2, String[] fields, boolean nullAsFirst)
public static <T extends Comparable<? super T>> int compareTwoComparableObject(T l1, T l2, boolean nullAsFirst)
T - 比较对对象类型l1 - 参数1l2 - 参数2nullAsFirst - true null 在最前面否则在最后面comparepublic static <T extends Comparable<? super T>> int compareTwoComparableObject(T l1, T l2)
public static <T,U extends Comparable<? super U>> Comparator<T> comparing(Function<? super T,? extends U> keyExtractor, boolean nullAsFirst)
T - 比较对象类型U - 比较主键类型keyExtractor - 获取主键方法nullAsFirst - true null 在最前面否则在最后面public static Object addTwoObject(Object a, Object b, boolean nullSensitive)
a - object1b - object2nullSensitive - 在数字计算是null敏感,就是有一个数为null则结果为nullpublic static Object maxObject(Collection<Object> ar)
public static Object minObject(Collection<Object> ar)
public static Object sumObjects(Collection<Object> ar)
public static boolean isEmpty(Object obj)
obj - 被判断的对象Copyright © 2025 江苏南大先腾信息产业股份有限公司. All rights reserved.