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:de.schildbach.game.chess.ChessPosition.java
@Override public boolean equals(Object o) { if (o == null) return false; if (!super.equals(o)) return false; ChessPosition other = (ChessPosition) o; if (!Arrays.equals(castlingAvailableWhite, other.castlingAvailableWhite)) return false; if (!Arrays.equals(castlingAvailableBlack, other.castlingAvailableBlack)) return false; if (!ObjectUtils.equals(this.enPassantTargetSquare, other.enPassantTargetSquare)) return false; return true;/*from w w w . ja v a 2 s .c om*/ }
From source file:com.opengamma.financial.analytics.curve.CurveSpecification.java
@Override public boolean equals(final Object obj) { if (this == obj) { return true; }/*from w ww.ja v a2s.c om*/ if (!(obj instanceof CurveSpecification)) { return false; } final CurveSpecification other = (CurveSpecification) obj; if (!ObjectUtils.equals(_name, other._name)) { return false; } if (!ObjectUtils.equals(_curveDate, other._curveDate)) { return false; } if (!ObjectUtils.equals(_nodes, other._nodes)) { return false; } return true; }
From source file:com.opengamma.financial.analytics.curve.InterpolatedCurveSpecification.java
@Override public boolean equals(final Object obj) { if (this == obj) { return true; }//from w w w . ja v a 2 s .c o m if (!(obj instanceof InterpolatedCurveSpecification)) { return false; } if (!super.equals(obj)) { return false; } final InterpolatedCurveSpecification other = (InterpolatedCurveSpecification) obj; return ObjectUtils.equals(_interpolatorName, other._interpolatorName) && ObjectUtils.equals(_rightExtrapolatorName, other._rightExtrapolatorName) && ObjectUtils.equals(_leftExtrapolatorName, other._leftExtrapolatorName); }
From source file:de.codesourcery.eve.skills.db.datamodel.Region.java
public static boolean isSameRegion(Region r1, Region r2) { final Long id1 = getRegionId(r1); final Long id2 = getRegionId(r2); return ObjectUtils.equals(id1, id2); }
From source file:com.autentia.wuija.widget.query.QuickQuery.java
public void valueChangeListener(ValueChangeEvent event) { final String newValue = (String) event.getNewValue(); if (ObjectUtils.equals(newValue, criterion.getValues().get(0))) { return;//from www. ja v a 2 s .c o m } if (log.isDebugEnabled()) { log.debug("New quick search: " + newValue); } criterion.setValues(newValue); search(); }
From source file:com.opengamma.analytics.financial.var.parametric.DeltaGammaCovarianceMatrixStandardDeviationCalculator.java
@Override public boolean equals(final Object obj) { if (this == obj) { return true; }/*w w w . j ava2s .c om*/ if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final DeltaGammaCovarianceMatrixStandardDeviationCalculator other = (DeltaGammaCovarianceMatrixStandardDeviationCalculator) obj; return ObjectUtils.equals(_algebra, other._algebra); }
From source file:com.opengamma.analytics.financial.instrument.index.GeneratorSwapFuturesDeliverable.java
@Override public boolean equals(final Object obj) { if (this == obj) { return true; }/* w ww. j a va 2 s. com*/ if (!super.equals(obj)) { return false; } if (getClass() != obj.getClass()) { return false; } final GeneratorSwapFuturesDeliverable other = (GeneratorSwapFuturesDeliverable) obj; if (!ObjectUtils.equals(_security, other._security)) { return false; } return true; }
From source file:com.opengamma.analytics.financial.model.interestrate.definition.LiborMarketModelDisplacedDiffusionDataBundle.java
@Override public boolean equals(final Object obj) { if (this == obj) { return true; }/*www. ja v a2 s. co m*/ if (!super.equals(obj)) { return false; } if (!(obj instanceof LiborMarketModelDisplacedDiffusionDataBundle)) { return false; } final LiborMarketModelDisplacedDiffusionDataBundle other = (LiborMarketModelDisplacedDiffusionDataBundle) obj; if (!ObjectUtils.equals(_parameters, other._parameters)) { return false; } return true; }
From source file:com.github.lukaszkusek.xml.comparator.comparators.attributes.XMLAttributesComparator.java
private DifferenceDetails compareAttributesWithTheSameName(Node node1, Node node2, String attributeName) { Pattern pattern = valueExtractors.get(node1.getXPath() + "/@" + attributeName); String attribute1Value = node1.extractAttributeValue(attributeName, pattern); String attribute2Value = node2.extractAttributeValue(attributeName, pattern); if (!ObjectUtils.equals(attribute1Value, attribute2Value)) { return DifferenceDetails.of(node1, node2, attributeName, DifferenceCode.DIFFERENT_ATTRIBUTE_VALUE); }//from w ww.ja va2 s . com return DifferenceDetails.empty(); }
From source file:com.haulmont.cuba.gui.data.impl.PropertyDatasourceImpl.java
protected void initParentDsListeners() { masterDs.addItemChangeListener(e -> { Entity prevValue = getItem(e.getPrevItem()); Entity newValue = getItem(e.getItem()); reattachListeners(prevValue, newValue); fireItemChanged((T) prevValue);// www. j a v a2 s.co m }); masterDs.addStateChangeListener(e -> fireStateChanged(e.getPrevState())); masterDs.addItemPropertyChangeListener(e -> { if (e.getProperty().equals(metaProperty.getName()) && !ObjectUtils.equals(e.getPrevValue(), e.getValue())) { reattachListeners((Entity) e.getPrevValue(), (Entity) e.getValue()); fireItemChanged((T) e.getPrevValue()); } }); }