Class BuilderSpec.Builder

java.lang.Object
com.google.auto.value.processor.BuilderSpec.Builder
Enclosing class:
BuilderSpec

class BuilderSpec.Builder extends Object
Representation of an AutoValue.Builder class or interface.
  • Field Details

    • builderTypeElement

      private final TypeElement builderTypeElement
    • toBuilderMethods

      private com.google.common.collect.ImmutableSet<ExecutableElement> toBuilderMethods
  • Constructor Details

  • Method Details

    • toBuilderMethods

      com.google.common.collect.ImmutableSet<ExecutableElement> toBuilderMethods(Types typeUtils, Set<ExecutableElement> abstractMethods)
      Finds any methods in the set that return the builder type. If the builder has type parameters <A, B>, then the return type of the method must be Builder<A, B> with the same parameter names. We enforce elsewhere that the names and bounds of the builder parameters must be the same as those of the @AutoValue class. Here's a correct example:
       @AutoValue abstract class Foo<A extends Number, B> {
         abstract int someProperty();
      
         abstract Builder<A, B> toBuilder();
      
         interface Builder<A extends Number, B> {...}
       }
       

      We currently impose that there cannot be more than one such method.

    • defineVars

      void defineVars(AutoValueTemplateVars vars, com.google.common.collect.ImmutableBiMap<ExecutableElement,String> getterToPropertyName)