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

/**
 * Set the value of LoggedFullUsers// ww w  .j a  v  a 2  s . co  m
 *
 * @param v new value
 */
public void setLoggedFullUsers(Integer v) {

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

}

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

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }//w w w.j a  v  a  2s  . c o m
    if (obj == null) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final BlackSwaptionParameters other = (BlackSwaptionParameters) 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.BaseTCostCenter.java

/**
 * Set the value of ObjectID/*w w  w.  j  a v  a  2 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 TDepartment
    if (collTDepartments != null) {
        for (int i = 0; i < collTDepartments.size(); i++) {
            ((TDepartment) collTDepartments.get(i)).setCostcenter(v);
        }
    }

    // update associated TAccount
    if (collTAccounts != null) {
        for (int i = 0; i < collTAccounts.size(); i++) {
            ((TAccount) collTAccounts.get(i)).setCostCenter(v);
        }
    }
}

From source file:com.opengamma.financial.analytics.ircurve.strips.CurveNodeWithIdentifier.java

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }// www .  ja va2  s .  c  om
    if (!(obj instanceof CurveNodeWithIdentifier)) {
        return false;
    }
    final CurveNodeWithIdentifier other = (CurveNodeWithIdentifier) obj;
    if (!ObjectUtils.equals(_identifier, other._identifier)) {
        return false;
    }
    if (!ObjectUtils.equals(_curveNode, other._curveNode)) {
        return false;
    }
    if (!ObjectUtils.equals(_dataField, other._dataField)) {
        return false;
    }
    if (_fieldType != other._fieldType) {
        return false;
    }
    return true;
}

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

/**
 * Set the value of CronWhen/*  w  w  w. j a  va2 s  . co m*/
 *
 * @param v new value
 */
public void setCronWhen(String v) {

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

}

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

/**
 * Set the value of ObjectID//www  .j  a  v  a2  s  . 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 TGridField
    if (collTGridFields != null) {
        for (int i = 0; i < collTGridFields.size(); i++) {
            ((TGridField) collTGridFields.get(i)).setGridLayout(v);
        }
    }

    // update associated TGridGroupingSorting
    if (collTGridGroupingSortings != null) {
        for (int i = 0; i < collTGridGroupingSortings.size(); i++) {
            ((TGridGroupingSorting) collTGridGroupingSortings.get(i)).setGridLayout(v);
        }
    }
}

From source file:com.opengamma.financial.analytics.volatility.fittedresults.HestonFittedSurfaces.java

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }//from w  ww .  ja  v  a 2  s  . c o  m
    if (!(obj instanceof HestonFittedSurfaces)) {
        return false;
    }
    final HestonFittedSurfaces other = (HestonFittedSurfaces) obj;
    if (!ObjectUtils.equals(_kappaSurface, other._kappaSurface)) {
        return false;
    }
    if (!ObjectUtils.equals(_thetaSurface, other._thetaSurface)) {
        return false;
    }
    if (!ObjectUtils.equals(_vol0Surface, other._vol0Surface)) {
        return false;
    }
    if (!ObjectUtils.equals(_omegaSurface, other._omegaSurface)) {
        return false;
    }
    if (!ObjectUtils.equals(_rhoSurface, other._rhoSurface)) {
        return false;
    }
    if (!ObjectUtils.equals(_inverseJacobian, other._inverseJacobian)) {
        return false;
    }
    if (!ObjectUtils.equals(_currency, other._currency)) {
        return false;
    }
    return true;
}

From source file:de.csdev.ebus.service.device.EBusDeviceTable.java

public void updateDevice(byte address, Map<String, Object> data) {

    boolean newDevice = false;
    boolean updatedDevice = false;

    if (address == EBusConsts.BROADCAST_ADDRESS) {
        return;/*from  w  w w  .  jav a 2s  . c om*/
    } else if (EBusUtils.isMasterAddress(address)) {
        address = EBusUtils.getSlaveAddress(address);
    }

    if (address == getOwnDevice().getSlaveAddress()) {
        // ignore own address
        return;
    }

    EBusDevice device = deviceTable.get(address);

    if (device == null) {
        device = new EBusDevice(address, this);
        device.setLastActivity(System.currentTimeMillis());
        deviceTable.put(address, device);
        newDevice = true;
    }

    device.setLastActivity(System.currentTimeMillis());

    if (data != null && !data.isEmpty()) {

        Object obj = data.get("device_id");
        if (obj != null && !obj.equals(device.getDeviceId())) {
            device.setDeviceId((byte[]) obj);
            updatedDevice = true;
        }

        BigDecimal obj2 = NumberUtils.toBigDecimal(data.get("hardware_version"));
        if (obj2 != null && !ObjectUtils.equals(obj2, device.getHardwareVersion())) {
            device.setHardwareVersion(obj2);
            updatedDevice = true;
        }

        obj2 = NumberUtils.toBigDecimal(data.get("software_version"));
        if (obj2 != null && !ObjectUtils.equals(obj2, device.getSoftwareVersion())) {
            device.setSoftwareVersion(obj2);
            updatedDevice = true;
        }

        obj2 = NumberUtils.toBigDecimal(data.get("vendor"));
        if (obj2 != null && !ObjectUtils.equals(obj2.byteValue(), device.getManufacturer())) {
            int intValue = obj2.intValue();
            device.setManufacturer((byte) intValue);
            updatedDevice = true;
        }
    }

    if (newDevice) {
        fireOnDeviceUpdate(IEBusDeviceTableListener.TYPE.NEW, device);
    } else if (updatedDevice) {
        fireOnDeviceUpdate(IEBusDeviceTableListener.TYPE.UPDATE, device);
    } else {
        fireOnDeviceUpdate(IEBusDeviceTableListener.TYPE.UPDATE_ACTIVITY, device);
    }
}

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

/**
 * Set the value of ObjectID//from  w ww. j  a 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 TPersonBasket
    if (collTPersonBaskets != null) {
        for (int i = 0; i < collTPersonBaskets.size(); i++) {
            ((TPersonBasket) collTPersonBaskets.get(i)).setBasket(v);
        }
    }
}

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

/**
 * Set the value of WorkFlow/*from  w  w  w . j a  v a2  s .  c o  m*/
 *
 * @param v new value
 */
public void setWorkFlow(Integer v) throws TorqueException {

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

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

}