Example usage for org.apache.commons.lang ObjectUtils equals

List of usage examples for org.apache.commons.lang ObjectUtils equals

Introduction

In this page you can find the example usage for org.apache.commons.lang ObjectUtils equals.

Prototype

public static boolean equals(Object object1, Object object2) 

Source Link

Document

Compares two objects for equality, where either one or both objects may be null.

 ObjectUtils.equals(null, null)                  = true ObjectUtils.equals(null, "")                    = false ObjectUtils.equals("", null)                    = false ObjectUtils.equals("", "")                      = true ObjectUtils.equals(Boolean.TRUE, null)          = false ObjectUtils.equals(Boolean.TRUE, "true")        = false ObjectUtils.equals(Boolean.TRUE, Boolean.TRUE)  = true ObjectUtils.equals(Boolean.TRUE, Boolean.FALSE) = false 

Usage

From source file:com.aurel.track.persist.BaseTOutlineTemplate.java

/**
 * Set the value of ObjectID/*from  w  w  w  .j av a 2 s.  c o m*/
 *
 * @param v new value
 */
public void setObjectID(Integer v) throws TorqueException {

    if (!ObjectUtils.equals(this.objectID, v)) {
        this.objectID = v;
        setModified(true);
    }

    // update associated TOutlineCode
    if (collTOutlineCodes != null) {
        for (int i = 0; i < collTOutlineCodes.size(); i++) {
            ((TOutlineCode) collTOutlineCodes.get(i)).setOutlineTemplate(v);
        }
    }

    // update associated TOutlineTemplateDef
    if (collTOutlineTemplateDefs != null) {
        for (int i = 0; i < collTOutlineTemplateDefs.size(); i++) {
            ((TOutlineTemplateDef) collTOutlineTemplateDefs.get(i)).setOutlineTemplate(v);
        }
    }
}

From source file:com.opengamma.analytics.financial.interestrate.cash.derivative.DepositIbor.java

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }//from ww w.j av a2 s  .  co m
    if (!super.equals(obj)) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final DepositIbor other = (DepositIbor) obj;
    if (!ObjectUtils.equals(_index, other._index)) {
        return false;
    }
    return true;
}

From source file:com.aurel.track.persist.BaseTUserFeature.java

/**
 * Set the value of FeatureName//www  . java  2 s .  c  om
 *
 * @param v new value
 */
public void setFeatureName(String v) {

    if (!ObjectUtils.equals(this.featureName, v)) {
        this.featureName = v;
        setModified(true);
    }

}

From source file:io.viewserver.operators.sort.SortOperator.java

private boolean configChanged(ISortConfig config) {
    if (this.config == null) {
        return true;
    }/*  www.ja v a  2 s . c  o m*/

    return !ObjectUtils.equals(config.getSortDescriptor(), this.config.getSortDescriptor())
            || config.getStart() != this.config.getStart() || config.getEnd() != this.config.getEnd();
}

From source file:com.aurel.track.persist.BaseTAccessControlList.java

/**
 * Set the value of PersonID/*  w  w  w. j  ava  2 s .  c o  m*/
 *
 * @param v new value
 */
public void setPersonID(Integer v) throws TorqueException {

    if (!ObjectUtils.equals(this.personID, v)) {
        this.personID = v;
        setModified(true);
    }

    if (aTPerson != null && !ObjectUtils.equals(aTPerson.getObjectID(), v)) {
        aTPerson = null;
    }

}

From source file:com.aurel.track.persist.BaseTEffortType.java

/**
 * Set the value of ObjectID/*  w w w  .  j  a  v  a2s  .  c om*/
 *
 * @param v new value
 */
public void setObjectID(Integer v) throws TorqueException {

    if (!ObjectUtils.equals(this.objectID, v)) {
        this.objectID = v;
        setModified(true);
    }

    // update associated TCost
    if (collTCosts != null) {
        for (int i = 0; i < collTCosts.size(); i++) {
            ((TCost) collTCosts.get(i)).setEfforttype(v);
        }
    }
}

From source file:com.aurel.track.persist.BaseTRepository.java

/**
 * Set the value of ObjectID/*from   w ww  .ja v a 2  s. c o  m*/
 *
 * @param v new value
 */
public void setObjectID(Integer v) throws TorqueException {

    if (!ObjectUtils.equals(this.objectID, v)) {
        this.objectID = v;
        setModified(true);
    }

    // update associated TRevision
    if (collTRevisions != null) {
        for (int i = 0; i < collTRevisions.size(); i++) {
            ((TRevision) collTRevisions.get(i)).setRepositoryKey(v);
        }
    }
}

From source file:com.opengamma.engine.view.cycle.LiveDataDeltaCalculator.java

private boolean computeDelta(final DependencyNode node) {
    if (_changedNodes.contains(node)) {
        return true;
    }/*w  w w  .  j a v a  2  s  .c  o m*/
    if (_unchangedNodes.contains(node)) {
        return false;
    }
    boolean hasChanged = false;
    Collection<DependencyNode> inputNodes = node.getInputNodes();
    if (inputNodes.isEmpty()) {
        if (node.isMarketDataSourcingFunction()) {
            // This is a graph leaf, but market data changes may affect the function of the node.
            for (ValueSpecification liveData : node.getOutputValues()) {
                // Market data is always in the shared cache
                final Object oldValue = _previousCache.getValue(liveData, CacheSelectHint.allShared());
                final Object newValue = _cache.getValue(liveData, CacheSelectHint.allShared());
                if (!ObjectUtils.equals(oldValue, newValue)) {
                    hasChanged = true;
                    break;
                }
            }
        }
        // Note: an "else" branch here is where we'd support "volatile" functions
    } else {
        for (final DependencyNode inputNode : inputNodes) {
            // if any children changed, this node requires recalculation
            hasChanged |= computeDelta(inputNode);
        }
    }
    if (hasChanged) {
        _changedNodes.add(node);
    } else {
        _unchangedNodes.add(node);
    }
    return hasChanged;
}

From source file:ca.sqlpower.wabit.report.selectors.ComboBoxSelector.java

public void setSourceKey(String sourceKey) {

    String oldSourceKey = this.sourceKey;

    if (sourceKey != null) {
        this.sourceKey = sourceKey.replaceFirst("\\$", "").replaceFirst("\\{", "").replaceFirst("\\}", "");
    } else {/*w ww.ja v a  2 s .c o  m*/
        this.sourceKey = null;
    }

    if (!ObjectUtils.equals(this.sourceKey, oldSourceKey)) {

        Collection<Object> values = getPossibleValues();

        if (values.size() > 0) {
            this.setSelectedValue(values.iterator().next());
        } else {
            this.setSelectedValue(null);
        }

        firePropertyChange("sourceKey", oldSourceKey, this.sourceKey);
        fireSelectionChanged();
    }
}

From source file:com.opengamma.analytics.financial.interestrate.future.derivative.FederalFundsFutureTransaction.java

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }//w  w  w .ja va 2 s.c o m
    if (obj == null) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final FederalFundsFutureTransaction other = (FederalFundsFutureTransaction) obj;
    if (_quantity != other._quantity) {
        return false;
    }
    if (Double.doubleToLongBits(_referencePrice) != Double.doubleToLongBits(other._referencePrice)) {
        return false;
    }
    if (!ObjectUtils.equals(_underlyingFuture, other._underlyingFuture)) {
        return false;
    }
    return true;
}