org.vertexium.Property Maven / Gradle / Ivy
package org.vertexium;
public abstract class Property implements Comparable {
public abstract String getKey();
public abstract String getName();
public abstract Object getValue();
public abstract long getTimestamp();
public abstract Visibility getVisibility();
public abstract Metadata getMetadata();
public abstract FetchHints getFetchHints();
public abstract Iterable getHiddenVisibilities();
public abstract boolean isHidden(Authorizations authorizations);
@Override
public int compareTo(Property o) {
int i = getName().compareTo(o.getName());
if (i != 0) {
return i;
}
i = getKey().compareTo(o.getKey());
if (i != 0) {
return i;
}
return getVisibility().compareTo(o.getVisibility());
}
@Override
public int hashCode() {
return getName().hashCode() ^ (getKey() == null ? 0 : getKey().hashCode()) ^ getVisibility().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj instanceof Property) {
Property other = (Property) obj;
return getName().equals(other.getName())
&& ((getKey() == null && other.getKey() == null) || (getKey() != null && getKey().equals(other.getKey())))
&& getVisibility().equals(other.getVisibility());
}
return super.equals(obj);
}
@Override
public String toString() {
return "[" + getName() + ":" + getKey() + ":" + getVisibility() + "]";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy