001package arez.annotations;
002
003import arez.EqualityComparator;
004import java.lang.annotation.Documented;
005import java.lang.annotation.ElementType;
006import java.lang.annotation.Target;
007import javax.annotation.Nonnull;
008
009/**
010 * Annotation applied to a type to declare the default {@link EqualityComparator} used by
011 * {@link Observable} and {@link Memoize} members when they do not explicitly specify an
012 * {@code equalityComparator}.
013 *
014 * <p>The annotation processor only considers the exact declared type of the observable or
015 * memoized value. It does not walk supertypes, interfaces, array component types, or
016 * type-use annotations.</p>
017 *
018 * <p>An explicit {@code equalityComparator} configured on {@link Observable} or
019 * {@link Memoize} always overrides the type-level default.</p>
020 */
021@Documented
022@Target( ElementType.TYPE )
023public @interface DefaultEqualityComparator
024{
025  /**
026   * Return the default equality comparator associated with the annotated type.
027   *
028   * @return the comparator type.
029   */
030  @Nonnull
031  Class<? extends EqualityComparator> value();
032}