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.ocs.dynamo.domain.AbstractEntity.java

/**
 * Basic equals function. Override this (and of the hashCode() method) if your entity has a more
 * meaningful key//from   ww  w.j  a  va2 s . c  om
 * 
 * @param obj
 * @return
 */
@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }
    if (obj == null || !this.getClass().isAssignableFrom(obj.getClass())) {
        return false;
    }

    return ObjectUtils.equals(this.getId(), ((AbstractEntity<?>) obj).getId());
}

From source file:com.tesora.dve.sql.node.expression.GroupConcatCall.java

@Override
protected boolean schemaSelfEqual(LanguageNode other) {
    if (!super.schemaSelfEqual(other))
        return false;
    GroupConcatCall gcc = (GroupConcatCall) other;
    return ObjectUtils.equals(separator, gcc.separator);
}

From source file:com.opengamma.financial.analytics.fixedincome.YieldCurveNodeSensitivityDataBundle.java

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }/*from   www  .  j av a 2s  . c o  m*/
    if (obj == null) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final YieldCurveNodeSensitivityDataBundle other = (YieldCurveNodeSensitivityDataBundle) obj;
    if (!ObjectUtils.equals(_labelledMatrix, other._labelledMatrix)) {
        return false;
    }
    if (!ObjectUtils.equals(_yieldCurveName, other._yieldCurveName)) {
        return false;
    }
    return ObjectUtils.equals(_currency, other._currency);
}

From source file:com.xtructure.xutil.valid.object.IsEqualToCondition.java

/**
 * {@inheritDoc}//from  w ww .  j a  va2 s  .  c  o  m
 * 
 * @return true if the given object is equal to this condition's value,
 *         false otherwise
 */
@Override
public boolean isSatisfiedBy(Object object) {
    return ObjectUtils.equals(getValue(), object);
}

From source file:com.opengamma.masterdb.security.hibernate.future.FutureBundleBean.java

@Override
public boolean equals(final Object o) {
    if (o == this) {
        return true;
    }/*from   w  w w  .  j  ava  2s. c om*/
    if (o == null) {
        return false;
    }
    if (!(o instanceof FutureBundleBean)) {
        return false;
    }
    final FutureBundleBean other = (FutureBundleBean) o;
    return ObjectUtils.equals(getFuture().getId(), other.getFuture().getId())
            && ObjectUtils.equals(getConversionFactor(), other.getConversionFactor())
            && ObjectUtils.equals(getIdentifiers(), other.getIdentifiers());
}

From source file:com.ocs.dynamo.dao.query.FetchJoinInformation.java

@Override
public boolean equals(Object obj) {
    if (!(obj instanceof FetchJoinInformation)) {
        return false;
    }//from www . j a  v a  2 s.  c  o m
    FetchJoinInformation other = (FetchJoinInformation) obj;
    return ObjectUtils.equals(this.getProperty(), other.getProperty())
            && ObjectUtils.equals(this.getJoinType(), other.getJoinType());
}

From source file:com.haulmont.cuba.gui.data.impl.testmodel1.TestMasterEntity.java

public void setDetail(TestDetailEntity detail) {
    TestDetailEntity o = this.detail;
    this.detail = detail;
    if (!ObjectUtils.equals(o, detail))
        propertyChanged("detail", o, detail);
}

From source file:com.opengamma.analytics.math.statistics.leastsquare.GeneralizedLeastSquareResults.java

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }/* w w w . java2 s .  c  o  m*/
    if (!super.equals(obj)) {
        return false;
    }
    if (!(obj instanceof GeneralizedLeastSquareResults)) {
        return false;
    }
    final GeneralizedLeastSquareResults<?> other = (GeneralizedLeastSquareResults<?>) obj;
    if (!ObjectUtils.equals(_function, other._function)) {
        return false;
    }
    return true;
}

From source file:com.opengamma.analytics.financial.model.option.definition.FXOptionDataBundle.java

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }//from  w  w  w  . ja v a2 s .  co  m
    if (!super.equals(obj)) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final FXOptionDataBundle other = (FXOptionDataBundle) obj;
    return ObjectUtils.equals(_foreignInterestRate, other._foreignInterestRate);
}

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

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }//from w  w w  .  j  a v a 2 s . c o  m
    if (obj == null) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final SmileAndBucketedSensitivities other = (SmileAndBucketedSensitivities) obj;
    if (!ObjectUtils.equals(_smile, other._smile)) {
        return false;
    }
    if (!Arrays.deepEquals(_sensitivities, other._sensitivities)) {
        return false;
    }
    return true;
}