Enum BuilderFactory

java.lang.Object
java.lang.Enum<BuilderFactory>
org.inferred.freebuilder.processor.BuilderFactory
All Implemented Interfaces:
Serializable, Comparable<BuilderFactory>, java.lang.constant.Constable

public enum BuilderFactory extends Enum<BuilderFactory>
Standard ways of constructing a default Builder.
  • Enum Constant Details

    • NO_ARGS_CONSTRUCTOR

      public static final BuilderFactory NO_ARGS_CONSTRUCTOR
      A new Builder can be made by calling the class' no-args constructor.
    • BUILDER_METHOD

      public static final BuilderFactory BUILDER_METHOD
      The enclosing class provides a static builder() factory method.
    • NEW_BUILDER_METHOD

      public static final BuilderFactory NEW_BUILDER_METHOD
      The enclosing class provides a static newBuilder() factory method.
  • Constructor Details

    • BuilderFactory

      private BuilderFactory()
  • Method Details

    • values

      public static BuilderFactory[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static BuilderFactory valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • from

      public static Optional<BuilderFactory> from(TypeElement builderType)
      Determines the correct way of constructing a default builderType instance, if any.
    • newBuilder

      public abstract Excerpt newBuilder(Type builderType, BuilderFactory.TypeInference typeInference)
      Returns an excerpt calling the Builder factory method.
    • typeIsAbstract

      private static boolean typeIsAbstract(TypeElement type)
    • hasNoArgsConstructor

      static boolean hasNoArgsConstructor(TypeElement type)
    • findPotentialStaticFactoryMethods

      private static com.google.common.collect.ImmutableSet<String> findPotentialStaticFactoryMethods(TypeElement builderType)