/** * Checks whether the given object is equal to this one. See the * {@link #equal(PropertyState, PropertyState)} method for the definition * of property state equality. Subclasses may override this method with * a more efficient equality check if one is available. * * @param other target of the comparison * @return {@code true} if the objects are equal, {@code false} otherwise */ @Override public boolean equals(Object other) { if (this == other) { return true; } else { return other instanceof PropertyState && equal(this, (PropertyState) other); } }
/** * Checks whether the given object is equal to this one. See the * {@link #equal(PropertyState, PropertyState)} method for the definition * of property state equality. Subclasses may override this method with * a more efficient equality check if one is available. * * @param other target of the comparison * @return {@code true} if the objects are equal, {@code false} otherwise */ @Override public boolean equals(Object other) { if (this == other) { return true; } else { return other instanceof PropertyState && equal(this, (PropertyState) other); } }
@Override public boolean equals(Object object) { if (this == object) { return true; } else if (object instanceof DocumentPropertyState) { DocumentPropertyState other = (DocumentPropertyState) object; return this.name.equals(other.name) && this.value.equals(other.value); } // fall back to default equality check in AbstractPropertyState return object instanceof PropertyState && AbstractPropertyState.equal(parsed(), (PropertyState) object); }
@Override public boolean equals(Object object) { if (this == object) { return true; } else if (object instanceof DocumentPropertyState) { DocumentPropertyState other = (DocumentPropertyState) object; return this.name.equals(other.name) && this.value.equals(other.value); } // fall back to default equality check in AbstractPropertyState return object instanceof PropertyState && AbstractPropertyState.equal(parsed(), (PropertyState) object); }
@Override public boolean equals(Object object) { // optimize for common cases if (this == object) { // don't use fastEquals here due to value sharing return true; } if (object instanceof SegmentPropertyState) { SegmentPropertyState that = (SegmentPropertyState) object; if (!type.equals(that.type) || !name.equals(that.name)) { return false; } else if (getRecordId().equals(that.getRecordId())) { return true; } } // fall back to default equality check in AbstractPropertyState return object instanceof PropertyState && AbstractPropertyState.equal(this, (PropertyState) object); }