Enum BuilderFactory
- java.lang.Object
-
- java.lang.Enum<BuilderFactory>
-
- org.inferred.freebuilder.processor.BuilderFactory
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<BuilderFactory>
public enum BuilderFactory extends java.lang.Enum<BuilderFactory>
Standard ways of constructing a default Builder.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBuilderFactory.TypeInference
-
Enum Constant Summary
Enum Constants Enum Constant Description BUILDER_METHODThe enclosing class provides a static builder() factory method.NEW_BUILDER_METHODThe enclosing class provides a static newBuilder() factory method.NO_ARGS_CONSTRUCTORA new Builder can be made by calling the class' no-args constructor.
-
Constructor Summary
Constructors Modifier Constructor Description privateBuilderFactory()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private static com.google.common.collect.ImmutableSet<java.lang.String>findPotentialStaticFactoryMethods(javax.lang.model.element.TypeElement builderType)static java.util.Optional<BuilderFactory>from(javax.lang.model.element.TypeElement builderType)Determines the correct way of constructing a defaultbuilderTypeinstance, if any.(package private) static booleanhasNoArgsConstructor(javax.lang.model.element.TypeElement type)abstract ExcerptnewBuilder(Type builderType, BuilderFactory.TypeInference typeInference)Returns an excerpt calling the Builder factory method.private static booleantypeIsAbstract(javax.lang.model.element.TypeElement type)static BuilderFactoryvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static BuilderFactory[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
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.
-
-
Method Detail
-
values
public static BuilderFactory[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (BuilderFactory c : BuilderFactory.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static BuilderFactory valueOf(java.lang.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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
from
public static java.util.Optional<BuilderFactory> from(javax.lang.model.element.TypeElement builderType)
Determines the correct way of constructing a defaultbuilderTypeinstance, 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(javax.lang.model.element.TypeElement type)
-
hasNoArgsConstructor
static boolean hasNoArgsConstructor(javax.lang.model.element.TypeElement type)
-
findPotentialStaticFactoryMethods
private static com.google.common.collect.ImmutableSet<java.lang.String> findPotentialStaticFactoryMethods(javax.lang.model.element.TypeElement builderType)
-
-