Class ImmutableProto.Protoclass.Builder
java.lang.Object
org.immutables.value.processor.meta.ImmutableProto.Protoclass.Builder
- Enclosing class:
ImmutableProto.Protoclass
Builds instances of type
Protoclass.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate com.google.common.base.Optional<Proto.DeclaringType> private Proto.Environmentprivate static final longprivate static final longprivate static final longprivate static final longprivate longprivate Proto.Protoclass.Kindprivate static final longprivate longprivate Proto.DeclaringPackageprivate Element -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newProtoclass.private static voidcheckNotIsSet(boolean isSet, String name) private voiddeclaringType(com.google.common.base.Optional<? extends Proto.DeclaringType> declaringType) Initializes the optional valuedeclaringTypeto declaringType.declaringType(Proto.DeclaringType declaringType) Initializes the optional valuedeclaringTypeto declaringType.private booleanenvironment(Proto.Environment environment) Initializes the value for theenvironmentattribute.private booleanprivate Stringkind(Proto.Protoclass.Kind kind) Initializes the value for thekindattribute.private booleanpackageOf(Proto.DeclaringPackage packageOf) Initializes the value for thepackageOfattribute.private booleansourceElement(Element sourceElement) Initializes the value for thesourceElementattribute.private boolean
-
Field Details
-
INIT_BIT_ENVIRONMENT
private static final long INIT_BIT_ENVIRONMENT- See Also:
-
INIT_BIT_SOURCE_ELEMENT
private static final long INIT_BIT_SOURCE_ELEMENT- See Also:
-
INIT_BIT_PACKAGE_OF
private static final long INIT_BIT_PACKAGE_OF- See Also:
-
INIT_BIT_KIND
private static final long INIT_BIT_KIND- See Also:
-
OPT_BIT_DECLARING_TYPE
private static final long OPT_BIT_DECLARING_TYPE- See Also:
-
initBits
private long initBits -
optBits
private long optBits -
environment
-
sourceElement
-
packageOf
-
declaringType
-
kind
-
-
Constructor Details
-
Builder
private Builder()
-
-
Method Details
-
environment
Initializes the value for theenvironmentattribute.- Parameters:
environment- The value for environment- Returns:
thisbuilder for use in a chained invocation
-
sourceElement
Initializes the value for thesourceElementattribute.- Parameters:
sourceElement- The value for sourceElement- Returns:
thisbuilder for use in a chained invocation
-
packageOf
Initializes the value for thepackageOfattribute.- Parameters:
packageOf- The value for packageOf- Returns:
thisbuilder for use in a chained invocation
-
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
Initializes the value for thekindattribute.- Parameters:
kind- The value for kind- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newProtoclass.- Returns:
- An immutable instance of Protoclass
- Throws:
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
-
checkRequiredAttributes
private void checkRequiredAttributes() -
formatRequiredAttributesMessage
-