Class ImmutableProto.Protoclass.Builder
- java.lang.Object
-
- org.immutables.value.processor.meta.ImmutableProto.Protoclass.Builder
-
- Enclosing class:
- ImmutableProto.Protoclass
@NotThreadSafe public static final class ImmutableProto.Protoclass.Builder extends java.lang.ObjectBuilds instances of typeProtoclass. 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 com.google.common.base.Optional<Proto.DeclaringType>declaringTypeprivate Proto.Environmentenvironmentprivate static longINIT_BIT_ENVIRONMENTprivate static longINIT_BIT_KINDprivate static longINIT_BIT_PACKAGE_OFprivate static longINIT_BIT_SOURCE_ELEMENTprivate longinitBitsprivate Proto.Protoclass.Kindkindprivate static longOPT_BIT_DECLARING_TYPEprivate longoptBitsprivate Proto.DeclaringPackagepackageOfprivate javax.lang.model.element.ElementsourceElement
-
Constructor Summary
Constructors Modifier Constructor Description privateBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableProto.Protoclassbuild()Builds a newProtoclass.private static voidcheckNotIsSet(boolean isSet, java.lang.String name)private voidcheckRequiredAttributes()ImmutableProto.Protoclass.BuilderdeclaringType(com.google.common.base.Optional<? extends Proto.DeclaringType> declaringType)Initializes the optional valuedeclaringTypeto declaringType.ImmutableProto.Protoclass.BuilderdeclaringType(Proto.DeclaringType declaringType)Initializes the optional valuedeclaringTypeto declaringType.private booleandeclaringTypeIsSet()ImmutableProto.Protoclass.Builderenvironment(Proto.Environment environment)Initializes the value for theenvironmentattribute.private booleanenvironmentIsSet()private java.lang.StringformatRequiredAttributesMessage()ImmutableProto.Protoclass.Builderkind(Proto.Protoclass.Kind kind)Initializes the value for thekindattribute.private booleankindIsSet()ImmutableProto.Protoclass.BuilderpackageOf(Proto.DeclaringPackage packageOf)Initializes the value for thepackageOfattribute.private booleanpackageOfIsSet()ImmutableProto.Protoclass.BuildersourceElement(javax.lang.model.element.Element sourceElement)Initializes the value for thesourceElementattribute.private booleansourceElementIsSet()
-
-
-
Field Detail
-
INIT_BIT_ENVIRONMENT
private static final long INIT_BIT_ENVIRONMENT
- See Also:
- Constant Field Values
-
INIT_BIT_SOURCE_ELEMENT
private static final long INIT_BIT_SOURCE_ELEMENT
- See Also:
- Constant Field Values
-
INIT_BIT_PACKAGE_OF
private static final long INIT_BIT_PACKAGE_OF
- See Also:
- Constant Field Values
-
INIT_BIT_KIND
private static final long INIT_BIT_KIND
- See Also:
- Constant Field Values
-
OPT_BIT_DECLARING_TYPE
private static final long OPT_BIT_DECLARING_TYPE
- See Also:
- Constant Field Values
-
initBits
private long initBits
-
optBits
private long optBits
-
environment
@Nullable private Proto.Environment environment
-
sourceElement
@Nullable private javax.lang.model.element.Element sourceElement
-
packageOf
@Nullable private Proto.DeclaringPackage packageOf
-
declaringType
private com.google.common.base.Optional<Proto.DeclaringType> declaringType
-
kind
@Nullable private Proto.Protoclass.Kind kind
-
-
Method Detail
-
environment
public final ImmutableProto.Protoclass.Builder environment(Proto.Environment environment)
Initializes the value for theenvironmentattribute.- Parameters:
environment- The value for environment- Returns:
thisbuilder for use in a chained invocation
-
sourceElement
public final ImmutableProto.Protoclass.Builder sourceElement(javax.lang.model.element.Element sourceElement)
Initializes the value for thesourceElementattribute.- Parameters:
sourceElement- The value for sourceElement- Returns:
thisbuilder for use in a chained invocation
-
packageOf
public final ImmutableProto.Protoclass.Builder packageOf(Proto.DeclaringPackage packageOf)
Initializes the value for thepackageOfattribute.- Parameters:
packageOf- The value for packageOf- Returns:
thisbuilder for use in a chained invocation
-
declaringType
public final ImmutableProto.Protoclass.Builder declaringType(Proto.DeclaringType declaringType)
Initializes the optional valuedeclaringTypeto declaringType.- Parameters:
declaringType- The value for declaringType- Returns:
thisbuilder for chained invocation
-
declaringType
public final ImmutableProto.Protoclass.Builder declaringType(com.google.common.base.Optional<? extends Proto.DeclaringType> declaringType)
Initializes the optional valuedeclaringTypeto declaringType.- Parameters:
declaringType- The value for declaringType- Returns:
thisbuilder for use in a chained invocation
-
kind
public final ImmutableProto.Protoclass.Builder kind(Proto.Protoclass.Kind kind)
Initializes the value for thekindattribute.- Parameters:
kind- The value for kind- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableProto.Protoclass build()
Builds a newProtoclass.- Returns:
- An immutable instance of Protoclass
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-
declaringTypeIsSet
private boolean declaringTypeIsSet()
-
environmentIsSet
private boolean environmentIsSet()
-
sourceElementIsSet
private boolean sourceElementIsSet()
-
packageOfIsSet
private boolean packageOfIsSet()
-
kindIsSet
private boolean kindIsSet()
-
checkNotIsSet
private static void checkNotIsSet(boolean isSet, java.lang.String name)
-
checkRequiredAttributes
private void checkRequiredAttributes()
-
formatRequiredAttributesMessage
private java.lang.String formatRequiredAttributesMessage()
-
-