Annotation Type AutoValue


@Retention(CLASS) @Target(TYPE) public @interface AutoValue
Specifies that AutoValue should generate an implementation class for the annotated abstract class, implementing the standard Object methods like equals to have conventional value semantics. A simple example:

  @AutoValue
  abstract class Person {
    static Person create(String name, int id) {
      return new AutoValue_Person(name, id);
    }

    abstract String name();
    abstract int id();
  }
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static @interface 
    Specifies that AutoValue should generate an implementation of the annotated class or interface, to serve as a builder for the value-type class it is nested within.
    static @interface 
    Specifies that AutoValue should copy any annotations from the annotated element to the generated class.