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.opengamma.analytics.financial.var.parametric.DeltaGammaCovarianceMatrixMeanCalculator.java

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

From source file:com.vaadin.addon.jpacontainer.testdata.EmbeddedIdPerson.java

@Override
public boolean equals(Object obj) {
    if (obj.getClass() == getClass()) {
        EmbeddedIdPerson other = (EmbeddedIdPerson) obj;
        return ObjectUtils.equals(name, other.name) && ObjectUtils.equals(address, other.address)
                && (ObjectUtils.equals(dateOfBirth, other.dateOfBirth) || (dateOfBirth != null
                        && other.dateOfBirth != null && DateUtils.isSameDay(dateOfBirth, other.dateOfBirth)));
    } else {/*from ww  w.  j av a  2  s  . c o  m*/
        return false;
    }
}

From source file:com.opengamma.livedata.LiveDataValueUpdateBean.java

@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }/*  w  w  w .j av a  2 s.  co m*/
    if (obj instanceof LiveDataValueUpdateBean) {
        LiveDataValueUpdateBean other = (LiveDataValueUpdateBean) obj;
        return _sequenceNumber == other._sequenceNumber
                && ObjectUtils.equals(_specification, other._specification)
                && ObjectUtils.equals(_fieldContainer, other._fieldContainer);
    }
    return false;
}

From source file:com.opengamma.util.log.LogbackLogEvent.java

@Override
public boolean equals(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 (!(obj instanceof LogbackLogEvent)) {
        return false;
    }
    LogbackLogEvent other = (LogbackLogEvent) obj;
    return ObjectUtils.equals(_loggingEvent, other._loggingEvent);
}

From source file:jef.common.Entry.java

@SuppressWarnings("rawtypes")
@Override//from   w w  w . j a v a 2 s.  co  m
public boolean equals(Object obj) {
    if (obj instanceof Entry) {
        if (!ObjectUtils.equals(((Entry) obj).getKey(), key))
            return false;
        if (!ObjectUtils.equals(((Entry) obj).getValue(), value))
            return false;
        return true;
    } else {
        return false;
    }
}

From source file:com.opengamma.analytics.financial.interestrate.inflation.derivative.CouponInflation.java

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }/*from  ww w.j a v a 2s.  co  m*/
    if (!super.equals(obj)) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final CouponInflation other = (CouponInflation) obj;
    if (!ObjectUtils.equals(_priceIndex, other._priceIndex)) {
        return false;
    }
    return true;
}

From source file:com.manydesigns.portofino.database.StringBooleanType.java

public boolean equals(Object x, Object y) throws HibernateException {
    return ObjectUtils.equals(x, y);
}

From source file:de.iai.ilcd.webgui.controller.admin.UserListHandler.java

/**
 * {@inheritDoc}//  ww  w .j a v a 2  s.c  om
 */
@Override
public void deleteSelected() {
    final User[] selectedItems = this.getSelectedItems();
    if (selectedItems == null) {
        return;
    }

    for (User item : selectedItems) {
        // Admin user not deletable
        if (ObjectUtils.equals(item.getId(), SodaUtil.ADMIN_ID)) {
            continue; // not selectable in facelet and not deletable (double check)
        }
        try {
            this.getDao().remove(item);
            this.addI18NFacesMessage("facesMsg.removeSuccess", FacesMessage.SEVERITY_INFO, item.getUserName());
        } catch (Exception ex) {
            this.addI18NFacesMessage("facesMsg.removeError", FacesMessage.SEVERITY_ERROR, item.getUserName());
        }
    }

    this.clearSelection();
    this.reloadCount();
}

From source file:be.fgov.kszbcss.rhq.websphere.component.server.log.J2EEComponentKey.java

@Override
public boolean equals(Object obj) {
    if (obj instanceof J2EEComponentKey) {
        J2EEComponentKey other = (J2EEComponentKey) obj;
        return applicationName.equals(other.applicationName) && moduleName.equals(other.moduleName)
                && ObjectUtils.equals(componentName, componentName);
    } else {//w w w  .j av  a 2 s  . c o  m
        return false;
    }
}

From source file:com.opengamma.financial.analytics.volatility.cube.VolatilityCubeFunctionHelper.java

public boolean canApplyTo(final FunctionCompilationContext context, final ComputationTarget target) {
    if (target.getType() != ComputationTargetType.PRIMITIVE) {
        return false;
    }//from  ww w  .ja  v a 2 s  .  c  om
    return ObjectUtils.equals(target.getUniqueId(), _currency.getUniqueId());
}