當前位置: 首頁>>代碼示例>>Java>>正文


Java ObjectUtils.equals方法代碼示例

本文整理匯總了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;
    }
}
 
開發者ID:m18507308080,項目名稱:onolisa,代碼行數:17,代碼來源:ShardInfo4Jedis.java

示例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;
    }
}
 
開發者ID:m18507308080,項目名稱:onolisa,代碼行數:17,代碼來源:DefaultJedisPool.java

示例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;
    }
}
 
開發者ID:m18507308080,項目名稱:onolisa,代碼行數:17,代碼來源:NodeInfo4Jedis.java

示例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;
}
 
開發者ID:liuht777,項目名稱:uncode-scheduler,代碼行數:30,代碼來源:TaskDefine.java

示例5: isMoveDoable

import org.apache.commons.lang3.ObjectUtils; //導入方法依賴的package包/類
public boolean isMoveDoable(ScoreDirector scoreDirector) {
    return !ObjectUtils.equals(shiftAssignment.getEmployee(), toEmployee);
}
 
開發者ID:bibryam,項目名稱:rotabuilder,代碼行數:4,代碼來源:EmployeeChangeMove.java

示例6: isMoveDoable

import org.apache.commons.lang3.ObjectUtils; //導入方法依賴的package包/類
public boolean isMoveDoable(ScoreDirector scoreDirector) {
    return !ObjectUtils.equals(leftShiftAssignment.getEmployee(), rightShiftAssignment.getEmployee());
}
 
開發者ID:bibryam,項目名稱:rotabuilder,代碼行數:4,代碼來源:ShiftAssignmentSwapMove.java

示例7: isMoveDoable

import org.apache.commons.lang3.ObjectUtils; //導入方法依賴的package包/類
public boolean isMoveDoable(ScoreDirector scoreDirector) {
    return !ObjectUtils.equals(fromEmployee, toEmployee);
}
 
開發者ID:bibryam,項目名稱:rotabuilder,代碼行數:4,代碼來源:EmployeeMultipleChangeMove.java

示例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);
            }
        }
    }
}
 
開發者ID:goldmansachs,項目名稱:obevo,代碼行數:47,代碼來源:DeepCompareUtil.java


注:本文中的org.apache.commons.lang3.ObjectUtils.equals方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。