@Retention(value=CLASS)
@Target(value={TYPE,METHOD})
public static @interface AutoValue.CopyAnnotations
The following annotations are excluded:
exclude()
field;
Inherited
meta-annotation.
When the type of an @AutoValue
property method has annotations, those are
part of the type, so they are always copied to the implementation of the method.
@CopyAnnotations
has no effect here. For example, suppose @Confidential
is a
TYPE_USE
annotation:
@AutoValue abstract class Person { static Person create(@Confidential String name, int id) { return new AutoValue_Person(name, id); } abstract @Confidential String name(); abstract int id(); }Then the implementation of the
name()
method will also have return type
@Confidential String
.Modifier and Type | Optional Element and Description |
---|---|
java.lang.Class<? extends java.lang.annotation.Annotation>[] |
exclude |
Copyright © 2018 Google, Inc.. All Rights Reserved.