List of usage examples for org.apache.commons.lang ObjectUtils equals
public static boolean equals(Object object1, Object object2)
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
From source file:com.aurel.track.persist.BaseTEscalationState.java
/** * Set the value of Escalationentry/*from ww w . ja v a 2 s.co m*/ * * @param v new value */ public void setEscalationentry(Integer v) throws TorqueException { if (!ObjectUtils.equals(this.escalationentry, v)) { this.escalationentry = v; setModified(true); } if (aTEscalationEntry != null && !ObjectUtils.equals(aTEscalationEntry.getObjectID(), v)) { aTEscalationEntry = null; } }
From source file:com.aurel.track.persist.BaseTDashboardTab.java
/** * Set the value of ObjectID//from w w w .jav 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 TDashboardPanel if (collTDashboardPanels != null) { for (int i = 0; i < collTDashboardPanels.size(); i++) { ((TDashboardPanel) collTDashboardPanels.get(i)).setParent(v); } } }
From source file:com.opengamma.analytics.financial.model.option.definition.GeneralNormalOptionDataBundle.java
@Override public boolean equals(final Object obj) { if (this == obj) { return true; }/*w w w .ja v a 2 s. c o m*/ if (!super.equals(obj)) { return false; } if (getClass() != obj.getClass()) { return false; } final GeneralNormalOptionDataBundle other = (GeneralNormalOptionDataBundle) obj; return ObjectUtils.equals(_drift, other._drift); }
From source file:com.opengamma.analytics.math.surface.FunctionalDoublesSurface.java
@Override public boolean equals(final Object obj) { if (this == obj) { return true; }/*from ww w. j a v a 2 s . c om*/ if (!super.equals(obj)) { return false; } if (getClass() != obj.getClass()) { return false; } final FunctionalDoublesSurface other = (FunctionalDoublesSurface) obj; return ObjectUtils.equals(_function, other._function); }
From source file:com.aurel.track.persist.BaseTReportPersonSettings.java
/** * Set the value of ObjectID//from w w w.j av a2 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 TReportParameter if (collTReportParameters != null) { for (int i = 0; i < collTReportParameters.size(); i++) { ((TReportParameter) collTReportParameters.get(i)).setReportPersonSettings(v); } } }
From source file:dz.alkhwarizmix.trouvauto.java.model.vo.ReservautoResponse.java
@Override public boolean equals(final Object other) { final boolean result = super.equals(other) && (getObjectAsThisClass(other) != null) && ObjectUtils.equals(ExtensionData, getObjectAsThisClass(other).ExtensionData) && ObjectUtils.equals(UserPosition, getObjectAsThisClass(other).UserPosition) && ObjectUtils.equals(Vehicules, getObjectAsThisClass(other).Vehicules); return result; }
From source file:com.haulmont.cuba.gui.data.impl.AbstractTreeDatasource.java
@Override public boolean isRoot(K itemId) { if (nodes == null || tree == null) { return false; }//from w w w.j av a2 s . c om final Node<T> node = nodes.get(itemId); for (Node<T> tNode : tree.getRootNodes()) { if (ObjectUtils.equals(tNode, node)) { return true; } } return false; }
From source file:com.haulmont.cuba.core.entity.BaseGenericIdEntity.java
@Override public void setValue(String property, Object newValue, boolean checkEquals) { if (this instanceof HasUuid && DynamicAttributesUtils.isDynamicAttribute(property)) { Preconditions.checkState(dynamicAttributes != null, "Dynamic attributes should be loaded explicitly"); String attributeCode = DynamicAttributesUtils.decodeAttributeCode(property); CategoryAttributeValue categoryAttributeValue = dynamicAttributes.get(attributeCode); Object oldValue = categoryAttributeValue != null ? categoryAttributeValue.getValue() : null; if (newValue == null) { if (categoryAttributeValue != null) { categoryAttributeValue.setValue(null); categoryAttributeValue.setDeleteTs(AppBeans.get(TimeSource.class).currentTimestamp()); propertyChanged(property, oldValue, null); }//from w w w .j a v a2 s . c o m } else if (!ObjectUtils.equals(oldValue, newValue)) { if (categoryAttributeValue != null) { categoryAttributeValue.setValue(newValue); categoryAttributeValue.setDeleteTs(null); } else { Metadata metadata = AppBeans.get(Metadata.NAME); categoryAttributeValue = metadata.create(CategoryAttributeValue.class); categoryAttributeValue.setValue(newValue); categoryAttributeValue.setEntityId(((HasUuid) this).getUuid()); categoryAttributeValue.setCode(attributeCode); DynamicAttributes dynamicAttributesBean = AppBeans.get(DynamicAttributes.NAME); categoryAttributeValue.setCategoryAttribute( dynamicAttributesBean.getAttributeForMetaClass(getMetaClass(), attributeCode)); dynamicAttributes.put(attributeCode, categoryAttributeValue); } propertyChanged(property, null, newValue); } } else { super.setValue(property, newValue, checkEquals); } }
From source file:com.aurel.track.persist.BaseTCLOB.java
/** * Set the value of ObjectID/*from www . j ava2s .com*/ * * @param v new value */ public void setObjectID(Integer v) throws TorqueException { if (!ObjectUtils.equals(this.objectID, v)) { this.objectID = v; setModified(true); } // update associated TEvent if (collTEvents != null) { for (int i = 0; i < collTEvents.size(); i++) { ((TEvent) collTEvents.get(i)).setEventScript(v); } } // update associated TQueryRepository if (collTQueryRepositorys != null) { for (int i = 0; i < collTQueryRepositorys.size(); i++) { ((TQueryRepository) collTQueryRepositorys.get(i)).setQueryKey(v); } } // update associated TLastExecutedQuery if (collTLastExecutedQuerys != null) { for (int i = 0; i < collTLastExecutedQuerys.size(); i++) { ((TLastExecutedQuery) collTLastExecutedQuerys.get(i)).setQueryClob(v); } } }
From source file:com.aurel.track.persist.BaseTDisableField.java
/** * Set the value of FieldName/*from www. j a v a 2 s. co m*/ * * @param v new value */ public void setFieldName(String v) { if (!ObjectUtils.equals(this.fieldName, v)) { this.fieldName = v; setModified(true); } }