Class ImmutableFacet.Builder
- java.lang.Object
-
- org.immutables.value.processor.meta.ImmutableFacet.Builder
-
- Enclosing class:
- ImmutableFacet
@NotThreadSafe public static final class ImmutableFacet.Builder extends java.lang.ObjectBuilds instances of typeImmutableFacet. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Field Summary
Fields Modifier and Type Field Description private RepositoryModel.CodeBlockconstructorprivate javax.lang.model.type.TypeMirrorfieldTypeprivate static longINIT_BIT_CONSTRUCTORprivate static longINIT_BIT_FIELD_TYPEprivate static longINIT_BIT_INTERFACE_TYPEprivate static longINIT_BIT_NAMEprivate longinitBitsprivate javax.lang.model.type.TypeMirrorinterfaceTypeprivate com.google.common.collect.ImmutableList.Builder<RepositoryModel.DelegateMethod>methodsprivate java.lang.Stringname
-
Constructor Summary
Constructors Modifier Constructor Description privateBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableFacet.BuilderaddAllMethods(java.lang.Iterable<? extends RepositoryModel.DelegateMethod> elements)Adds elements tomethodslist.ImmutableFacet.BuilderaddMethods(RepositoryModel.DelegateMethod element)Adds one element tomethodslist.ImmutableFacet.BuilderaddMethods(RepositoryModel.DelegateMethod... elements)Adds elements tomethodslist.ImmutableFacetbuild()Builds a newImmutableFacet.private static voidcheckNotIsSet(boolean isSet, java.lang.String name)private voidcheckRequiredAttributes()ImmutableFacet.Builderconstructor(RepositoryModel.CodeBlock constructor)Initializes the value for theconstructorattribute.private booleanconstructorIsSet()ImmutableFacet.BuilderfieldType(javax.lang.model.type.TypeMirror fieldType)Initializes the value for thefieldTypeattribute.private booleanfieldTypeIsSet()private java.lang.StringformatRequiredAttributesMessage()ImmutableFacet.BuilderinterfaceType(javax.lang.model.type.TypeMirror interfaceType)Initializes the value for theinterfaceTypeattribute.private booleaninterfaceTypeIsSet()ImmutableFacet.Buildername(java.lang.String name)Initializes the value for thenameattribute.private booleannameIsSet()
-
-
-
Field Detail
-
INIT_BIT_NAME
private static final long INIT_BIT_NAME
- See Also:
- Constant Field Values
-
INIT_BIT_INTERFACE_TYPE
private static final long INIT_BIT_INTERFACE_TYPE
- See Also:
- Constant Field Values
-
INIT_BIT_FIELD_TYPE
private static final long INIT_BIT_FIELD_TYPE
- See Also:
- Constant Field Values
-
INIT_BIT_CONSTRUCTOR
private static final long INIT_BIT_CONSTRUCTOR
- See Also:
- Constant Field Values
-
initBits
private long initBits
-
name
@Nullable private java.lang.String name
-
interfaceType
@Nullable private javax.lang.model.type.TypeMirror interfaceType
-
fieldType
@Nullable private javax.lang.model.type.TypeMirror fieldType
-
constructor
@Nullable private RepositoryModel.CodeBlock constructor
-
methods
private final com.google.common.collect.ImmutableList.Builder<RepositoryModel.DelegateMethod> methods
-
-
Method Detail
-
name
public final ImmutableFacet.Builder name(java.lang.String name)
Initializes the value for thenameattribute.- Parameters:
name- The value for name- Returns:
thisbuilder for use in a chained invocation
-
interfaceType
public final ImmutableFacet.Builder interfaceType(javax.lang.model.type.TypeMirror interfaceType)
Initializes the value for theinterfaceTypeattribute.- Parameters:
interfaceType- The value for interfaceType- Returns:
thisbuilder for use in a chained invocation
-
fieldType
public final ImmutableFacet.Builder fieldType(javax.lang.model.type.TypeMirror fieldType)
Initializes the value for thefieldTypeattribute.- Parameters:
fieldType- The value for fieldType- Returns:
thisbuilder for use in a chained invocation
-
constructor
public final ImmutableFacet.Builder constructor(RepositoryModel.CodeBlock constructor)
Initializes the value for theconstructorattribute.- Parameters:
constructor- The value for constructor- Returns:
thisbuilder for use in a chained invocation
-
addMethods
public final ImmutableFacet.Builder addMethods(RepositoryModel.DelegateMethod element)
Adds one element tomethodslist.- Parameters:
element- A methods element- Returns:
thisbuilder for use in a chained invocation
-
addMethods
public final ImmutableFacet.Builder addMethods(RepositoryModel.DelegateMethod... elements)
Adds elements tomethodslist.- Parameters:
elements- An array of methods elements- Returns:
thisbuilder for use in a chained invocation
-
addAllMethods
public final ImmutableFacet.Builder addAllMethods(java.lang.Iterable<? extends RepositoryModel.DelegateMethod> elements)
Adds elements tomethodslist.- Parameters:
elements- An iterable of methods elements- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableFacet build()
Builds a newImmutableFacet.- Returns:
- An immutable instance of Facet
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-
nameIsSet
private boolean nameIsSet()
-
interfaceTypeIsSet
private boolean interfaceTypeIsSet()
-
fieldTypeIsSet
private boolean fieldTypeIsSet()
-
constructorIsSet
private boolean constructorIsSet()
-
checkNotIsSet
private static void checkNotIsSet(boolean isSet, java.lang.String name)
-
checkRequiredAttributes
private void checkRequiredAttributes()
-
formatRequiredAttributesMessage
private java.lang.String formatRequiredAttributesMessage()
-
-