/** * Returns a <code>TLAnnotationDef</code> containing all the information from both arguments, or * <code>null</code> if the two arguments contradict each other; see {@link AnnotationDef#unify}. */ public static TLAnnotationDef unify( /*@NonNull*/ TLAnnotationDef tld1, /*@NonNull*/ TLAnnotationDef tld2) { if (tld1.equals(tld2)) return tld1; else if (tld1.retention.equals(tld2.retention)) { AnnotationDef ud = AnnotationDef.unify(tld1.def, tld2.def); if (ud == null) return null; else return new TLAnnotationDef(ud, tld1.retention); } else return null; }
/** {@inheritDoc} */ @Override public int hashCode() { return def.hashCode() + retention.hashCode(); }
/** * Returns whether this {@link TLAnnotationDef} equals <code>o</code>; a slightly faster variant * of {@link #equals(Object)} for when the argument is statically known to be another nonnull * {@link TLAnnotationDef}. */ public boolean equals(/*@NonNull*/ TLAnnotationDef o) { return def.equals(o.def) && extraEquals(o); }