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.BaseTEntityChanges.java

/**
 * Set the value of EntityKey/*from  w  ww  .  jav a2  s. c  om*/
 *
 * @param v new value
 */
public void setEntityKey(Integer v) {

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

}

From source file:com.opengamma.analytics.financial.model.interestrate.curve.PriceIndexCurveAddPriceIndexSpreadCurve.java

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }//from   w ww.  j  ava 2 s. c  o  m
    if (obj == null) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final PriceIndexCurveAddPriceIndexSpreadCurve other = (PriceIndexCurveAddPriceIndexSpreadCurve) obj;
    if (!ObjectUtils.equals(_curves, other._curves)) {
        return false;
    }
    if (Double.doubleToLongBits(_sign) != Double.doubleToLongBits(other._sign)) {
        return false;
    }
    return true;
}

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

private boolean computeDelta(DependencyNode node) {
    if (_changedNodes.contains(node)) {
        return true;
    }/*from  w w w .  j  av a 2  s  .c o  m*/
    if (_unchangedNodes.contains(node)) {
        return false;
    }

    boolean hasChanged = false;
    for (DependencyNode inputNode : node.getInputNodes()) {
        // if any children changed, this node automatically requires recomputation.
        hasChanged |= computeDelta(inputNode);
    }

    if (!hasChanged) {
        // if no children changed, the node may still require recomputation
        // due to market data changes affecting the function of the node.
        Pair<ValueRequirement, ValueSpecification> liveData = node.getRequiredMarketData();
        if (liveData != null) {
            // Market data is always in the shared cache
            Object oldValue = _previousCache.getValue(liveData.getSecond(), CacheSelectHint.allShared());
            Object newValue = _cache.getValue(liveData.getSecond(), CacheSelectHint.allShared());
            if (!ObjectUtils.equals(oldValue, newValue)) {
                hasChanged = true;
            }
        }
    }

    if (hasChanged) {
        _changedNodes.add(node);
    } else {
        _unchangedNodes.add(node);
    }

    return hasChanged;
}

From source file:com.opengamma.analytics.financial.model.volatility.surface.VolatilitySurface.java

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }/*from ww  w . ja va  2 s . c o  m*/
    if (obj == null) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final VolatilitySurface other = (VolatilitySurface) obj;
    return ObjectUtils.equals(_surface, other._surface);
}

From source file:com.vmware.identity.sts.Request.java

@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }//  w ww  .  j  a  va  2s .  c  o  m
    if (obj == null || getClass() != obj.getClass()) {
        return false;
    }

    Request other = (Request) obj;
    return header.equals(other.header) && rst.equals(other.rst)
            && ObjectUtils.equals(other.signature, signature) && ObjectUtils.equals(other.token, token)
            && ObjectUtils.equals(other.actAsToken, actAsToken);
}

From source file:com.opengamma.analytics.financial.model.option.parameters.BlackFlatSwaptionParameters.java

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }//from w  ww  .j  ava 2  s  .  co m
    if (obj == null) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final BlackFlatSwaptionParameters other = (BlackFlatSwaptionParameters) obj;
    if (!ObjectUtils.equals(_generatorSwap, other._generatorSwap)) {
        return false;
    }
    if (!ObjectUtils.equals(_volatility, other._volatility)) {
        return false;
    }
    return true;
}

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

/**
 * Set the value of Person/*w w  w .  j a  va  2 s . c om*/
 *
 * @param v new value
 */
public void setPerson(Integer v) {

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

}

From source file:de.fu_berlin.inf.dpp.activities.TextEditActivity.java

@Override
public boolean equals(Object obj) {
    if (this == obj)
        return true;
    if (!super.equals(obj))
        return false;
    if (!(obj instanceof TextEditActivity))
        return false;

    TextEditActivity other = (TextEditActivity) obj;

    if (this.offset != other.offset)
        return false;
    if (!ObjectUtils.equals(this.replacedText, other.replacedText))
        return false;
    if (!ObjectUtils.equals(this.text, other.text))
        return false;

    return true;/*from   w ww . j a  va 2  s  .com*/
}

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

/**
 * Set the value of ObjectID/*from w w w . 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 TCardFieldOption
    if (collTCardFieldOptions != null) {
        for (int i = 0; i < collTCardFieldOptions.size(); i++) {
            ((TCardFieldOption) collTCardFieldOptions.get(i)).setGroupingField(v);
        }
    }
}

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

/**
 * Set the value of ObjectID//from  w ww .  j av  a2 s . co 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 TWorkItem
    if (collTWorkItems != null) {
        for (int i = 0; i < collTWorkItems.size(); i++) {
            ((TWorkItem) collTWorkItems.get(i)).setClassID(v);
        }
    }
}