本文整理匯總了Java中org.apache.commons.lang3.ObjectUtils.equals方法的典型用法代碼示例。如果您正苦於以下問題:Java ObjectUtils.equals方法的具體用法?Java ObjectUtils.equals怎麽用?Java ObjectUtils.equals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.commons.lang3.ObjectUtils
的用法示例。
在下文中一共展示了ObjectUtils.equals方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: equals
import org.apache.commons.lang3.ObjectUtils; //導入方法依賴的package包/類
/**
*
* equals
*
* @param obj 比較對象
* @return boolean 比較結果
*/
@Override
public boolean equals(Object obj) {
if (obj instanceof ShardInfo4Jedis) {
ShardInfo4Jedis that = (ShardInfo4Jedis) obj;
return ObjectUtils.equals(nodes, that.nodes) && ObjectUtils.equals(shardName, that.shardName);
} else {
return false;
}
}
示例2: equals
import org.apache.commons.lang3.ObjectUtils; //導入方法依賴的package包/類
/**
* 對象比較
*
* @param obj 被比較的對象
* @return 比較結果
*/
@Override
public boolean equals(Object obj) {
if (obj instanceof DefaultJedisPool) {
DefaultJedisPool that = (DefaultJedisPool) obj;
return ObjectUtils.equals(host, that.host) && ObjectUtils.equals(port, that.port)
&& ObjectUtils.equals(dbIndex, that.dbIndex);
} else {
return false;
}
}
示例3: equals
import org.apache.commons.lang3.ObjectUtils; //導入方法依賴的package包/類
/**
* 節點比較
*
* @param obj 比較對象
* @return boolean 比較結果
*/
@Override
public boolean equals(Object obj) {
if (obj instanceof NodeInfo4Jedis) {
NodeInfo4Jedis that = (NodeInfo4Jedis) obj;
return ObjectUtils.equals(ip, that.ip) && ObjectUtils.equals(port, that.port)
&& ObjectUtils.equals(dbIndex, that.dbIndex);
} else {
return false;
}
}
示例4: equals
import org.apache.commons.lang3.ObjectUtils; //導入方法依賴的package包/類
@Override
public boolean equals(Object obj) {
if (obj == null || !(obj instanceof TaskDefine)) {
return false;
}
TaskDefine ou = (TaskDefine) obj;
if (!ObjectUtils.equals(this.targetBean, ou.targetBean)) {
return false;
}
if (!ObjectUtils.equals(this.targetMethod, ou.targetMethod)) {
return false;
}
if (!ObjectUtils.equals(this.cronExpression, ou.cronExpression)) {
return false;
}
if (!ObjectUtils.equals(this.startTime, ou.startTime)) {
return false;
}
if (!ObjectUtils.equals(this.params, ou.params)) {
return false;
}
if (!ObjectUtils.equals(this.type, ou.type)) {
return false;
}
if (!ObjectUtils.equals(this.extKeySuffix, ou.extKeySuffix)) {
return false;
}
return this.period == ou.period;
}
示例5: isMoveDoable
import org.apache.commons.lang3.ObjectUtils; //導入方法依賴的package包/類
public boolean isMoveDoable(ScoreDirector scoreDirector) {
return !ObjectUtils.equals(shiftAssignment.getEmployee(), toEmployee);
}
示例6: isMoveDoable
import org.apache.commons.lang3.ObjectUtils; //導入方法依賴的package包/類
public boolean isMoveDoable(ScoreDirector scoreDirector) {
return !ObjectUtils.equals(leftShiftAssignment.getEmployee(), rightShiftAssignment.getEmployee());
}
示例7: isMoveDoable
import org.apache.commons.lang3.ObjectUtils; //導入方法依賴的package包/類
public boolean isMoveDoable(ScoreDirector scoreDirector) {
return !ObjectUtils.equals(fromEmployee, toEmployee);
}
示例8: compareObjectsInternal
import org.apache.commons.lang3.ObjectUtils; //導入方法依賴的package包/類
private void compareObjectsInternal(Object key, Object left, Object right, MutableCollection<CompareBreak> breaks) {
Class objectClass = left.getClass();
MutableCollection<ClassCompareInfo> classCompareInfos = this.getClassCompareInfos(objectClass);
if (classCompareInfos.isEmpty()) {
if (!ObjectUtils.equals(left, right)) {
breaks.add(new FieldCompareBreak(objectClass, key, left, right, "this", left, right));
}
} else {
for (ClassCompareInfo<Object> classCompareInfo : classCompareInfos) {
for (Pair<String, Function<Object, ?>> functionPair : classCompareInfo.getCompareFunctions()) {
Function<Object, ?> function = functionPair.getTwo();
Object leftFuncVal = function.valueOf(left);
Object rightFuncVal = function.valueOf(right);
if (leftFuncVal == null && rightFuncVal == null) {
continue; // no break - continue
} else if (leftFuncVal == null ^ rightFuncVal == null) { // XOR - if one of these is null, but not
// the other
breaks.add(new FieldCompareBreak(objectClass, key, left, right, functionPair.getOne(),
leftFuncVal, rightFuncVal));
} else {
MutableCollection<ClassCompareInfo> funcClassCompareInfos = this.getClassCompareInfos(leftFuncVal
.getClass());
if (funcClassCompareInfos.isEmpty()) {
if (!ObjectUtils.equals(leftFuncVal, rightFuncVal)) {
breaks.add(new FieldCompareBreak(objectClass, key, left, right, functionPair.getOne(),
leftFuncVal, rightFuncVal));
}
} else {
this.compareObjectsInternal(key, leftFuncVal, rightFuncVal, breaks);
}
}
}
for (CollectionFieldCompareInfo collectionCompareInfo : classCompareInfo.getCollectionComparisonInfos()) {
this.compareCollectionsInternal(collectionCompareInfo.getElementClass()
, (Collection) collectionCompareInfo.getCollectionFieldFunction().valueOf(left)
, (Collection) collectionCompareInfo.getCollectionFieldFunction().valueOf(right)
, breaks);
}
}
}
}