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.model.option.definition.StandardOptionWithSpotTimeSeriesDataBundle.java

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }/*from   www . j  a v a  2s.c om*/
    if (!super.equals(obj)) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final StandardOptionWithSpotTimeSeriesDataBundle other = (StandardOptionWithSpotTimeSeriesDataBundle) obj;
    return ObjectUtils.equals(_spotTS, other._spotTS);
}

From source file:jef.tools.Assert.java

/**
 * /*from w w w .ja  v  a  2 s .  com*/
 * @param obj1
 * @param obj2
 * @param string
 */
public static void notEquals(Object obj1, Object obj2, String string) {
    if (ObjectUtils.equals(obj1, obj2))
        throw new RuntimeException(string);
}

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

/**
 * Set the value of UserLevel/*  ww w. j a  v  a2  s.c  om*/
 *
 * @param v new value
 */
public void setUserLevel(Integer v) throws TorqueException {

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

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

}

From source file:com.haulmont.cuba.desktop.gui.components.DesktopFrameActionsHolder.java

public Action getAction(String id) {
    for (com.haulmont.cuba.gui.components.Action action : getActions()) {
        if (ObjectUtils.equals(action.getId(), id)) {
            return action;
        }//from  ww w .j a  v  a2s.  c  om
    }
    return null;
}

From source file:com.opengamma.analytics.financial.equity.future.derivative.EquityFuture.java

@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }/*  www .  j ava2s .c o  m*/
    if (obj == null) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    EquityFuture other = (EquityFuture) obj;

    if (!ObjectUtils.equals(_currency, other._currency)) {
        return false;
    }

    if (Double.doubleToLongBits(_unitAmount) != Double.doubleToLongBits(other._unitAmount)) {
        return false;
    }
    if (Double.doubleToLongBits(_strike) != Double.doubleToLongBits(other._strike)) {
        return false;
    }
    if (Double.doubleToLongBits(_timeToSettlement) != Double.doubleToLongBits(other._timeToSettlement)) {
        return false;
    }
    if (Double.doubleToLongBits(_timeToExpiry) != Double.doubleToLongBits(other._timeToExpiry)) {
        return false;
    }
    return true;

}

From source file:com.opengamma.financial.analytics.ircurve.FixedIncomeStripWithSecurity.java

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }//  ww  w  .j a v  a 2 s  . co  m
    if (obj instanceof FixedIncomeStripWithSecurity) {
        final FixedIncomeStripWithSecurity other = (FixedIncomeStripWithSecurity) obj;
        return ObjectUtils.equals(_originalStrip, other._originalStrip)
                && ObjectUtils.equals(_maturity, other._maturity)
                && ObjectUtils.equals(_security, other._security);
    }
    return false;
}

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

/**
 * Set the value of LogLevel/*from   w ww  .  j a  v  a2  s.c om*/
 *
 * @param v new value
 */
public void setLogLevel(String v) {

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

}

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

@Override
protected boolean schemaSelfEqual(LanguageNode other) {
    FunctionCall fc = (FunctionCall) other;
    if (!functionName.equals(fc.functionName))
        return false;
    if (!ObjectUtils.equals(sq, fc.sq))
        return false;
    return true;/*from  ww w.  j  a  v a  2s .c o m*/
}

From source file:net.sourceforge.jukebox.model.Settings.java

@Override
public final boolean equals(final Object other) {
    if (other == null || this.getClass() != other.getClass()) {
        return false;
    }/*from   w w  w. j  a  v  a2  s .c om*/
    return ObjectUtils.equals(this.contentFolder, ((Settings) other).contentFolder)
            && ObjectUtils.equals(this.playerUrl, ((Settings) other).playerUrl)
            && ObjectUtils.equals(this.modifiedDays, ((Settings) other).modifiedDays);
}

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

/**
 * Set the value of TheGroup/* ww w . j  av  a2 s. c  o  m*/
 *
 * @param v new value
 */
public void setTheGroup(Integer v) throws TorqueException {

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

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

}