Object工具类
allNotNull(Object… values) 检查所有元素是否为空,返回一个boolean
如果有一个元素为空返回false,所有元素不为空或元素为empty返回true
ObjectUtils.allNotNull() = true
ObjectUtils.allNotNull(, ) = true
ObjectUtils.allNotNull(null) = false
ObjectUtils.allNotNull(null, null) = false
ObjectUtils.allNotNull(null, ) = false
ObjectUtils.allNotNull(, null) = false
ObjectUtils.allNotNull(, *, null, *) = false
anyNotNull(Object… values) 检查元素是否为空,返回一个boolean
如果有一个元素不为空返回true
ObjectUtils.anyNotNull() = true
ObjectUtils.anyNotNull(, null) = true
ObjectUtils.anyNotNull(null, *) = true
ObjectUtils.anyNotNull(null, null, *, *) = true
ObjectUtils.anyNotNull(null) = false
ObjectUtils.anyNotNull(null, null) = false
clone(T obj) 拷贝一个对象并返回
compare(T c1, T c2) 比较两个对象,返回一个int值
defaultIfNull(T object, T defaultValue) 如果对象为空返回一个默认值
firstNonNull(T… values) 返回数组中第一个不为空的值
notEqual(Object object1, Object object2) 判断两个对象不相等,返回一个boolean
————————————————
版权声明:本文为CSDN博主「黎明哥CZY」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/cns15090972366/article/details/90751986