@Override public String marshal(AbstractId id) { return id == null ? null : id.canonicalID(); }
@Override public int hashCode() { if (hashCode == null) { hashCode = Objects.hash(canonicalID()); } return hashCode; }
@Override public int compareTo(AbstractId id) { requireNonNull(id, "id cannot be null"); return this.canonicalID().compareTo(id.canonicalID()); }
/** * AbstractID objects are considered equal if, and only if, they are of the same type and have the * same canonical identifier. */ @Override public boolean equals(final Object obj) { if (this == obj) return true; return obj != null && Objects.equals(getClass(), obj.getClass()) && Objects.equals(canonicalID(), ((AbstractId) obj).canonicalID()); }