/** * 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 int hashCode() { return AbstractPropertyState.hashCode(this); }
@Override public String toString() { return AbstractPropertyState.toString(this); }
public static String toString(PropertyState property) { String name = property.getName(); Type<?> type = property.getType(); if (type == Type.BINARIES) { return name + " = [" + property.count() + " binaries]"; } else if (type == Type.BINARY) { return name + " = {" + getBinarySize(property) + " bytes}"; } else { return name + " = " + property.getValue(type); } }
List<Blob> blobs = Lists.newArrayList(); for (Value value : values) { blobs.add(AbstractPropertyState.getBlob(value));
public static String toString(PropertyState property) { String name = property.getName(); Type<?> type = property.getType(); if (type == Type.BINARIES) { return name + " = [" + property.count() + " binaries]"; } else if (type == Type.BINARY) { return name + " = {" + getBinarySize(property) + " bytes}"; } else { return name + " = " + property.getValue(type); } }
List<Blob> blobs = Lists.newArrayList(); for (Value value : values) { blobs.add(AbstractPropertyState.getBlob(value));
/** * 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 String toString() { return AbstractPropertyState.toString(this); }
@Override public int hashCode() { return AbstractPropertyState.hashCode(this); }
@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 String toString() { return toString(this); }
@Override public int hashCode() { return AbstractPropertyState.hashCode(this); }
@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 String toString() { return toString(this); }
/** * Returns a hash code that's compatible with how the * {@link #equals(Object)} method is implemented. The current * implementation simply returns the hash code of the property name * since {@link PropertyState} instances are not intended for use as * hash keys. * * @return hash code */ @Override public int hashCode() { return hashCode(this); }
@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); }
@Override public String toString() { return AbstractPropertyState.toString(this); }
/** * Returns a hash code that's compatible with how the * {@link #equals(Object)} method is implemented. The current * implementation simply returns the hash code of the property name * since {@link PropertyState} instances are not intended for use as * hash keys. * * @return hash code */ @Override public int hashCode() { return hashCode(this); }