1 package org.pojomatic.annotations;
2
3 import static java.lang.annotation.ElementType.TYPE;
4 import static java.lang.annotation.RetentionPolicy.RUNTIME;
5
6 import java.lang.annotation.Documented;
7 import java.lang.annotation.Retention;
8 import java.lang.annotation.Target;
9
10 import org.pojomatic.Pojomatic;
11
12 /**
13 * Assigns the defaults for {@link Pojomatic} at the class level and provides a way to
14 * configure the automatic detection of properties.
15 * Note that this can is overridden (case by case) by the {@link Property}} annotation.
16 */
17 @Target(TYPE)
18 @Retention(RUNTIME)
19 @Documented
20 public @interface AutoProperty {
21 /**
22 * Which sets of {@link Pojomatic} operations ({@code equals}, {@code hashCode} and
23 * {@code toString}) should use properties, unless otherwise stated by {@link Property @Property}.
24 * @return Which operations should properties by default.
25 */
26 public DefaultPojomaticPolicy policy() default DefaultPojomaticPolicy.ALL;
27
28 /**
29 * Specifies whether to auto-detect properties by their fields, getters or not at all.
30 * @return whether to auto-detect properties by their fields, getters or not at all.
31 */
32 public AutoDetectPolicy autoDetect() default AutoDetectPolicy.FIELD;
33 }