Package com.google.auto.value
Annotation Type AutoBuilder
-
@Retention(CLASS) @Target(TYPE) public @interface AutoBuilderSpecifies that the annotated interface or abstract class should be implemented as a builder. This is still unstable; uses outside Google may break.A simple example:
@AutoBuilder(ofClass = Person.class) abstract class PersonBuilder { static PersonBuilder builder() { return new AutoBuilder_PersonBuilder(); } abstract PersonBuilder setName(String name); abstract PersonBuilder setId(int id); abstract Person build(); }- See Also:
- AutoBuilder User's Guide
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description java.lang.StringcallMethodThe static method fromofClass()to call when the build-method of the builder is called.java.lang.Class<?>ofClassThe class or interface containing the constructor or static method that the generated builder will eventually call.
-
-
-
Element Detail
-
callMethod
java.lang.String callMethod
The static method fromofClass()to call when the build-method of the builder is called. By default this is empty, meaning that a constructor rather than a static method should be called. There can be more than one method with the given name, or more than one constructor, in which case the one to call is the one whose parameter names and types correspond to the abstract methods of the class or interface with the@AutoBuilderannotation.- Default:
- ""
-
-