Class Datatype_Builder
- java.lang.Object
-
- org.inferred.freebuilder.processor.Datatype_Builder
-
- Direct Known Subclasses:
Datatype.Builder
@Generated("org.inferred.freebuilder.processor.Processor") abstract class Datatype_Builder extends java.lang.ObjectAuto-generated superclass ofDatatype.Builder, derived from the API ofDatatype.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classDatatype_Builder.Partialprivate static classDatatype_Builder.Propertyprivate static classDatatype_Builder.Rebuildableprivate static classDatatype_Builder.Value
-
Field Summary
-
Constructor Summary
Constructors Constructor Description Datatype_Builder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Datatype.BuilderaddAllGeneratedBuilderAnnotations(java.lang.Iterable<? extends Excerpt> elements)Adds each element ofelementsto the list to be returned fromDatatype.getGeneratedBuilderAnnotations().Datatype.BuilderaddAllGeneratedBuilderAnnotations(java.util.Spliterator<? extends Excerpt> elements)Adds each element ofelementsto the list to be returned fromDatatype.getGeneratedBuilderAnnotations().Datatype.BuilderaddAllGeneratedBuilderAnnotations(java.util.stream.BaseStream<? extends Excerpt,?> elements)Adds each element ofelementsto the list to be returned fromDatatype.getGeneratedBuilderAnnotations().Datatype.BuilderaddAllNestedClasses(java.lang.Iterable<? extends Excerpt> elements)Adds each element ofelementsto the list to be returned fromDatatype.getNestedClasses().Datatype.BuilderaddAllNestedClasses(java.util.Spliterator<? extends Excerpt> elements)Adds each element ofelementsto the list to be returned fromDatatype.getNestedClasses().Datatype.BuilderaddAllNestedClasses(java.util.stream.BaseStream<? extends Excerpt,?> elements)Adds each element ofelementsto the list to be returned fromDatatype.getNestedClasses().Datatype.BuilderaddAllValueTypeAnnotations(java.lang.Iterable<? extends Excerpt> elements)Adds each element ofelementsto the list to be returned fromDatatype.getValueTypeAnnotations().Datatype.BuilderaddAllValueTypeAnnotations(java.util.Spliterator<? extends Excerpt> elements)Adds each element ofelementsto the list to be returned fromDatatype.getValueTypeAnnotations().Datatype.BuilderaddAllValueTypeAnnotations(java.util.stream.BaseStream<? extends Excerpt,?> elements)Adds each element ofelementsto the list to be returned fromDatatype.getValueTypeAnnotations().Datatype.BuilderaddGeneratedBuilderAnnotations(Excerpt element)Addselementto the list to be returned fromDatatype.getGeneratedBuilderAnnotations().Datatype.BuilderaddGeneratedBuilderAnnotations(Excerpt... elements)Adds each element ofelementsto the list to be returned fromDatatype.getGeneratedBuilderAnnotations().Datatype.BuilderaddNestedClasses(Excerpt element)Addselementto the list to be returned fromDatatype.getNestedClasses().Datatype.BuilderaddNestedClasses(Excerpt... elements)Adds each element ofelementsto the list to be returned fromDatatype.getNestedClasses().Datatype.BuilderaddValueTypeAnnotations(Excerpt element)Addselementto the list to be returned fromDatatype.getValueTypeAnnotations().Datatype.BuilderaddValueTypeAnnotations(Excerpt... elements)Adds each element ofelementsto the list to be returned fromDatatype.getValueTypeAnnotations().Datatypebuild()Returns a newly-createdDatatypebased on the contents of thisBuilder.DatatypebuildPartial()Returns a newly-created partialDatatypefor use in unit tests.Datatype.Builderclear()Resets the state of this builder.Datatype.BuilderclearBuilderFactory()Sets the value to be returned byDatatype.getBuilderFactory()toOptional.empty().Datatype.BuilderclearGeneratedBuilderAnnotations()Clears the list to be returned fromDatatype.getGeneratedBuilderAnnotations().Datatype.BuilderclearNestedClasses()Clears the list to be returned fromDatatype.getNestedClasses().Datatype.BuilderclearRebuildableType()Sets the value to be returned byDatatype.getRebuildableType()toOptional.empty().Datatype.BuilderclearStandardMethodUnderrides()Removes all of the mappings from the map to be returned fromDatatype.getStandardMethodUnderrides().Datatype.BuilderclearValueTypeAnnotations()Clears the list to be returned fromDatatype.getValueTypeAnnotations().static Datatype.Builderfrom(Datatype value)Creates a new builder usingvalueas a template.TypegetBuilder()Returns the value that will be returned byDatatype.getBuilder().java.util.Optional<BuilderFactory>getBuilderFactory()Returns the value that will be returned byDatatype.getBuilderFactory().NameAndVisibilitygetBuildMethod()Returns the value that will be returned byDatatype.getBuildMethod().NameAndVisibilitygetBuildPartialMethod()Returns the value that will be returned byDatatype.getBuildPartialMethod().NameAndVisibilitygetClearMethod()Returns the value that will be returned byDatatype.getClearMethod().TypeClassgetGeneratedBuilder()Returns the value that will be returned byDatatype.getGeneratedBuilder().java.util.List<Excerpt>getGeneratedBuilderAnnotations()Returns an unmodifiable view of the list that will be returned byDatatype.getGeneratedBuilderAnnotations().booleangetHasToBuilderMethod()Returns the value that will be returned byDatatype.getHasToBuilderMethod().NameAndVisibilitygetMergeFromBuilderMethod()Returns the value that will be returned byDatatype.getMergeFromBuilderMethod().NameAndVisibilitygetMergeFromValueMethod()Returns the value that will be returned byDatatype.getMergeFromValueMethod().java.util.List<Excerpt>getNestedClasses()Returns an unmodifiable view of the list that will be returned byDatatype.getNestedClasses().TypeClassgetPartialType()Returns the value that will be returned byDatatype.getPartialType().TypeClassgetPropertyEnum()Returns the value that will be returned byDatatype.getPropertyEnum().java.util.Optional<TypeClass>getRebuildableType()Returns the value that will be returned byDatatype.getRebuildableType().java.util.Map<Datatype.StandardMethod,Datatype.UnderrideLevel>getStandardMethodUnderrides()Returns an unmodifiable view of the map that will be returned byDatatype.getStandardMethodUnderrides().TypeClassgetType()Returns the value that will be returned byDatatype.getType().TypeClassgetValueType()Returns the value that will be returned byDatatype.getValueType().java.util.List<Excerpt>getValueTypeAnnotations()Returns an unmodifiable view of the list that will be returned byDatatype.getValueTypeAnnotations().Datatype.VisibilitygetValueTypeVisibility()Returns the value that will be returned byDatatype.getValueTypeVisibility().booleanisBuilderSerializable()Returns the value that will be returned byDatatype.isBuilderSerializable().booleanisExtensible()Returns the value that will be returned byDatatype.isExtensible().booleanisInterfaceType()Returns the value that will be returned byDatatype.isInterfaceType().Datatype.BuildermapBuilder(java.util.function.UnaryOperator<Type> mapper)Replaces the value to be returned byDatatype.getBuilder()by applyingmapperto it and using the result.Datatype.BuildermapBuilderFactory(java.util.function.UnaryOperator<BuilderFactory> mapper)If the value to be returned byDatatype.getBuilderFactory()is present, replaces it by applyingmapperto it and using the result.Datatype.BuildermapBuilderSerializable(java.util.function.UnaryOperator<java.lang.Boolean> mapper)Replaces the value to be returned byDatatype.isBuilderSerializable()by applyingmapperto it and using the result.Datatype.BuildermapBuildMethod(java.util.function.UnaryOperator<NameAndVisibility> mapper)Replaces the value to be returned byDatatype.getBuildMethod()by applyingmapperto it and using the result.Datatype.BuildermapBuildPartialMethod(java.util.function.UnaryOperator<NameAndVisibility> mapper)Replaces the value to be returned byDatatype.getBuildPartialMethod()by applyingmapperto it and using the result.Datatype.BuildermapClearMethod(java.util.function.UnaryOperator<NameAndVisibility> mapper)Replaces the value to be returned byDatatype.getClearMethod()by applyingmapperto it and using the result.Datatype.BuildermapExtensible(java.util.function.UnaryOperator<java.lang.Boolean> mapper)Replaces the value to be returned byDatatype.isExtensible()by applyingmapperto it and using the result.Datatype.BuildermapGeneratedBuilder(java.util.function.UnaryOperator<TypeClass> mapper)Replaces the value to be returned byDatatype.getGeneratedBuilder()by applyingmapperto it and using the result.Datatype.BuildermapHasToBuilderMethod(java.util.function.UnaryOperator<java.lang.Boolean> mapper)Replaces the value to be returned byDatatype.getHasToBuilderMethod()by applyingmapperto it and using the result.Datatype.BuildermapInterfaceType(java.util.function.UnaryOperator<java.lang.Boolean> mapper)Replaces the value to be returned byDatatype.isInterfaceType()by applyingmapperto it and using the result.Datatype.BuildermapMergeFromBuilderMethod(java.util.function.UnaryOperator<NameAndVisibility> mapper)Replaces the value to be returned byDatatype.getMergeFromBuilderMethod()by applyingmapperto it and using the result.Datatype.BuildermapMergeFromValueMethod(java.util.function.UnaryOperator<NameAndVisibility> mapper)Replaces the value to be returned byDatatype.getMergeFromValueMethod()by applyingmapperto it and using the result.Datatype.BuildermapPartialType(java.util.function.UnaryOperator<TypeClass> mapper)Replaces the value to be returned byDatatype.getPartialType()by applyingmapperto it and using the result.Datatype.BuildermapPropertyEnum(java.util.function.UnaryOperator<TypeClass> mapper)Replaces the value to be returned byDatatype.getPropertyEnum()by applyingmapperto it and using the result.Datatype.BuildermapRebuildableType(java.util.function.UnaryOperator<TypeClass> mapper)If the value to be returned byDatatype.getRebuildableType()is present, replaces it by applyingmapperto it and using the result.Datatype.BuildermapType(java.util.function.UnaryOperator<TypeClass> mapper)Replaces the value to be returned byDatatype.getType()by applyingmapperto it and using the result.Datatype.BuildermapValueType(java.util.function.UnaryOperator<TypeClass> mapper)Replaces the value to be returned byDatatype.getValueType()by applyingmapperto it and using the result.Datatype.BuildermapValueTypeVisibility(java.util.function.UnaryOperator<Datatype.Visibility> mapper)Replaces the value to be returned byDatatype.getValueTypeVisibility()by applyingmapperto it and using the result.Datatype.BuildermergeFrom(Datatype value)Copies values fromvalue, appending to collections, and skipping empty optionals.Datatype.BuildermergeFrom(Datatype.Builder template)Copies values fromtemplate, appending to collections, and skipping empty optionals and unset properties.Datatype.BuildermutateGeneratedBuilderAnnotations(java.util.function.Consumer<? super java.util.List<Excerpt>> mutator)Appliesmutatorto the list to be returned fromDatatype.getGeneratedBuilderAnnotations().Datatype.BuildermutateNestedClasses(java.util.function.Consumer<? super java.util.List<Excerpt>> mutator)Appliesmutatorto the list to be returned fromDatatype.getNestedClasses().Datatype.BuildermutateStandardMethodUnderrides(java.util.function.Consumer<? super java.util.Map<Datatype.StandardMethod,Datatype.UnderrideLevel>> mutator)Invokesmutatorwith the map to be returned fromDatatype.getStandardMethodUnderrides().Datatype.BuildermutateValueTypeAnnotations(java.util.function.Consumer<? super java.util.List<Excerpt>> mutator)Appliesmutatorto the list to be returned fromDatatype.getValueTypeAnnotations().Datatype.BuilderputAllStandardMethodUnderrides(java.util.Map<? extends Datatype.StandardMethod,? extends Datatype.UnderrideLevel> map)Copies all of the mappings frommapto the map to be returned fromDatatype.getStandardMethodUnderrides().Datatype.BuilderputStandardMethodUnderrides(Datatype.StandardMethod key, Datatype.UnderrideLevel value)Datatype.BuilderremoveStandardMethodUnderrides(Datatype.StandardMethod key)Removes the mapping forkeyfrom the map to be returned fromDatatype.getStandardMethodUnderrides(), if one is present.Datatype.BuildersetBuilder(Type builder)Sets the value to be returned byDatatype.getBuilder().Datatype.BuildersetBuilderFactory(java.util.Optional<? extends BuilderFactory> builderFactory)Sets the value to be returned byDatatype.getBuilderFactory().Datatype.BuildersetBuilderFactory(BuilderFactory builderFactory)Sets the value to be returned byDatatype.getBuilderFactory().Datatype.BuildersetBuilderSerializable(boolean builderSerializable)Sets the value to be returned byDatatype.isBuilderSerializable().Datatype.BuildersetBuildMethod(NameAndVisibility buildMethod)Sets the value to be returned byDatatype.getBuildMethod().Datatype.BuildersetBuildPartialMethod(NameAndVisibility buildPartialMethod)Sets the value to be returned byDatatype.getBuildPartialMethod().Datatype.BuildersetClearMethod(NameAndVisibility clearMethod)Sets the value to be returned byDatatype.getClearMethod().Datatype.BuildersetExtensible(boolean extensible)Sets the value to be returned byDatatype.isExtensible().Datatype.BuildersetGeneratedBuilder(TypeClass generatedBuilder)Sets the value to be returned byDatatype.getGeneratedBuilder().Datatype.BuildersetHasToBuilderMethod(boolean hasToBuilderMethod)Sets the value to be returned byDatatype.getHasToBuilderMethod().Datatype.BuildersetInterfaceType(boolean interfaceType)Sets the value to be returned byDatatype.isInterfaceType().Datatype.BuildersetMergeFromBuilderMethod(NameAndVisibility mergeFromBuilderMethod)Sets the value to be returned byDatatype.getMergeFromBuilderMethod().Datatype.BuildersetMergeFromValueMethod(NameAndVisibility mergeFromValueMethod)Sets the value to be returned byDatatype.getMergeFromValueMethod().Datatype.BuildersetNullableBuilderFactory(BuilderFactory builderFactory)Sets the value to be returned byDatatype.getBuilderFactory().Datatype.BuildersetNullableRebuildableType(TypeClass rebuildableType)Sets the value to be returned byDatatype.getRebuildableType().Datatype.BuildersetPartialType(TypeClass partialType)Sets the value to be returned byDatatype.getPartialType().Datatype.BuildersetPropertyEnum(TypeClass propertyEnum)Sets the value to be returned byDatatype.getPropertyEnum().Datatype.BuildersetRebuildableType(java.util.Optional<? extends TypeClass> rebuildableType)Sets the value to be returned byDatatype.getRebuildableType().Datatype.BuildersetRebuildableType(TypeClass rebuildableType)Sets the value to be returned byDatatype.getRebuildableType().Datatype.BuildersetType(TypeClass type)Sets the value to be returned byDatatype.getType().Datatype.BuildersetValueType(TypeClass valueType)Sets the value to be returned byDatatype.getValueType().Datatype.BuildersetValueTypeVisibility(Datatype.Visibility valueTypeVisibility)Sets the value to be returned byDatatype.getValueTypeVisibility().
-
-
-
Field Detail
-
type
private TypeClass type
-
interfaceType
private boolean interfaceType
-
builder
private Type builder
-
extensible
private boolean extensible
-
builderFactory
private BuilderFactory builderFactory
-
generatedBuilder
private TypeClass generatedBuilder
-
valueType
private TypeClass valueType
-
partialType
private TypeClass partialType
-
rebuildableType
private TypeClass rebuildableType
-
propertyEnum
private TypeClass propertyEnum
-
standardMethodUnderrides
private final java.util.LinkedHashMap<Datatype.StandardMethod,Datatype.UnderrideLevel> standardMethodUnderrides
-
builderSerializable
private boolean builderSerializable
-
hasToBuilderMethod
private boolean hasToBuilderMethod
-
buildMethod
private NameAndVisibility buildMethod
-
buildPartialMethod
private NameAndVisibility buildPartialMethod
-
clearMethod
private NameAndVisibility clearMethod
-
mergeFromBuilderMethod
private NameAndVisibility mergeFromBuilderMethod
-
mergeFromValueMethod
private NameAndVisibility mergeFromValueMethod
-
generatedBuilderAnnotations
private java.util.List<Excerpt> generatedBuilderAnnotations
-
valueTypeAnnotations
private java.util.List<Excerpt> valueTypeAnnotations
-
valueTypeVisibility
private Datatype.Visibility valueTypeVisibility
-
nestedClasses
private java.util.List<Excerpt> nestedClasses
-
_unsetProperties
private final java.util.EnumSet<Datatype_Builder.Property> _unsetProperties
-
-
Method Detail
-
from
public static Datatype.Builder from(Datatype value)
Creates a new builder usingvalueas a template.If
valueis a partial, the builder will return more partials.
-
setType
public Datatype.Builder setType(TypeClass type)
Sets the value to be returned byDatatype.getType().- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- iftypeis null
-
mapType
public Datatype.Builder mapType(java.util.function.UnaryOperator<TypeClass> mapper)
Replaces the value to be returned byDatatype.getType()by applyingmapperto it and using the result.- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifmapperis null or returns nulljava.lang.IllegalStateException- if the field has not been set
-
getType
public TypeClass getType()
Returns the value that will be returned byDatatype.getType().- Throws:
java.lang.IllegalStateException- if the field has not been set
-
setInterfaceType
public Datatype.Builder setInterfaceType(boolean interfaceType)
Sets the value to be returned byDatatype.isInterfaceType().- Returns:
- this
Builderobject
-
mapInterfaceType
public Datatype.Builder mapInterfaceType(java.util.function.UnaryOperator<java.lang.Boolean> mapper)
Replaces the value to be returned byDatatype.isInterfaceType()by applyingmapperto it and using the result.- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifmapperis null or returns nulljava.lang.IllegalStateException- if the field has not been set
-
isInterfaceType
public boolean isInterfaceType()
Returns the value that will be returned byDatatype.isInterfaceType().- Throws:
java.lang.IllegalStateException- if the field has not been set
-
setBuilder
public Datatype.Builder setBuilder(Type builder)
Sets the value to be returned byDatatype.getBuilder().- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifbuilderis null
-
mapBuilder
public Datatype.Builder mapBuilder(java.util.function.UnaryOperator<Type> mapper)
Replaces the value to be returned byDatatype.getBuilder()by applyingmapperto it and using the result.- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifmapperis null or returns nulljava.lang.IllegalStateException- if the field has not been set
-
getBuilder
public Type getBuilder()
Returns the value that will be returned byDatatype.getBuilder().- Throws:
java.lang.IllegalStateException- if the field has not been set
-
setExtensible
public Datatype.Builder setExtensible(boolean extensible)
Sets the value to be returned byDatatype.isExtensible().- Returns:
- this
Builderobject
-
mapExtensible
public Datatype.Builder mapExtensible(java.util.function.UnaryOperator<java.lang.Boolean> mapper)
Replaces the value to be returned byDatatype.isExtensible()by applyingmapperto it and using the result.- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifmapperis null or returns nulljava.lang.IllegalStateException- if the field has not been set
-
isExtensible
public boolean isExtensible()
Returns the value that will be returned byDatatype.isExtensible().- Throws:
java.lang.IllegalStateException- if the field has not been set
-
setBuilderFactory
public Datatype.Builder setBuilderFactory(BuilderFactory builderFactory)
Sets the value to be returned byDatatype.getBuilderFactory().- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifbuilderFactoryis null
-
setBuilderFactory
public Datatype.Builder setBuilderFactory(java.util.Optional<? extends BuilderFactory> builderFactory)
Sets the value to be returned byDatatype.getBuilderFactory().- Returns:
- this
Builderobject
-
setNullableBuilderFactory
public Datatype.Builder setNullableBuilderFactory(BuilderFactory builderFactory)
Sets the value to be returned byDatatype.getBuilderFactory().- Returns:
- this
Builderobject
-
mapBuilderFactory
public Datatype.Builder mapBuilderFactory(java.util.function.UnaryOperator<BuilderFactory> mapper)
If the value to be returned byDatatype.getBuilderFactory()is present, replaces it by applyingmapperto it and using the result.If the result is null, clears the value.
- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifmapperis null
-
clearBuilderFactory
public Datatype.Builder clearBuilderFactory()
Sets the value to be returned byDatatype.getBuilderFactory()toOptional.empty().- Returns:
- this
Builderobject
-
getBuilderFactory
public java.util.Optional<BuilderFactory> getBuilderFactory()
Returns the value that will be returned byDatatype.getBuilderFactory().
-
setGeneratedBuilder
public Datatype.Builder setGeneratedBuilder(TypeClass generatedBuilder)
Sets the value to be returned byDatatype.getGeneratedBuilder().- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifgeneratedBuilderis null
-
mapGeneratedBuilder
public Datatype.Builder mapGeneratedBuilder(java.util.function.UnaryOperator<TypeClass> mapper)
Replaces the value to be returned byDatatype.getGeneratedBuilder()by applyingmapperto it and using the result.- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifmapperis null or returns nulljava.lang.IllegalStateException- if the field has not been set
-
getGeneratedBuilder
public TypeClass getGeneratedBuilder()
Returns the value that will be returned byDatatype.getGeneratedBuilder().- Throws:
java.lang.IllegalStateException- if the field has not been set
-
setValueType
public Datatype.Builder setValueType(TypeClass valueType)
Sets the value to be returned byDatatype.getValueType().- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifvalueTypeis null
-
mapValueType
public Datatype.Builder mapValueType(java.util.function.UnaryOperator<TypeClass> mapper)
Replaces the value to be returned byDatatype.getValueType()by applyingmapperto it and using the result.- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifmapperis null or returns nulljava.lang.IllegalStateException- if the field has not been set
-
getValueType
public TypeClass getValueType()
Returns the value that will be returned byDatatype.getValueType().- Throws:
java.lang.IllegalStateException- if the field has not been set
-
setPartialType
public Datatype.Builder setPartialType(TypeClass partialType)
Sets the value to be returned byDatatype.getPartialType().- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifpartialTypeis null
-
mapPartialType
public Datatype.Builder mapPartialType(java.util.function.UnaryOperator<TypeClass> mapper)
Replaces the value to be returned byDatatype.getPartialType()by applyingmapperto it and using the result.- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifmapperis null or returns nulljava.lang.IllegalStateException- if the field has not been set
-
getPartialType
public TypeClass getPartialType()
Returns the value that will be returned byDatatype.getPartialType().- Throws:
java.lang.IllegalStateException- if the field has not been set
-
setRebuildableType
public Datatype.Builder setRebuildableType(TypeClass rebuildableType)
Sets the value to be returned byDatatype.getRebuildableType().- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifrebuildableTypeis null
-
setRebuildableType
public Datatype.Builder setRebuildableType(java.util.Optional<? extends TypeClass> rebuildableType)
Sets the value to be returned byDatatype.getRebuildableType().- Returns:
- this
Builderobject
-
setNullableRebuildableType
public Datatype.Builder setNullableRebuildableType(TypeClass rebuildableType)
Sets the value to be returned byDatatype.getRebuildableType().- Returns:
- this
Builderobject
-
mapRebuildableType
public Datatype.Builder mapRebuildableType(java.util.function.UnaryOperator<TypeClass> mapper)
If the value to be returned byDatatype.getRebuildableType()is present, replaces it by applyingmapperto it and using the result.If the result is null, clears the value.
- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifmapperis null
-
clearRebuildableType
public Datatype.Builder clearRebuildableType()
Sets the value to be returned byDatatype.getRebuildableType()toOptional.empty().- Returns:
- this
Builderobject
-
getRebuildableType
public java.util.Optional<TypeClass> getRebuildableType()
Returns the value that will be returned byDatatype.getRebuildableType().
-
setPropertyEnum
public Datatype.Builder setPropertyEnum(TypeClass propertyEnum)
Sets the value to be returned byDatatype.getPropertyEnum().- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifpropertyEnumis null
-
mapPropertyEnum
public Datatype.Builder mapPropertyEnum(java.util.function.UnaryOperator<TypeClass> mapper)
Replaces the value to be returned byDatatype.getPropertyEnum()by applyingmapperto it and using the result.- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifmapperis null or returns nulljava.lang.IllegalStateException- if the field has not been set
-
getPropertyEnum
public TypeClass getPropertyEnum()
Returns the value that will be returned byDatatype.getPropertyEnum().- Throws:
java.lang.IllegalStateException- if the field has not been set
-
putStandardMethodUnderrides
public Datatype.Builder putStandardMethodUnderrides(Datatype.StandardMethod key, Datatype.UnderrideLevel value)
Associateskeywithvaluein the map to be returned fromDatatype.getStandardMethodUnderrides(). If the map previously contained a mapping for the key, the old value is replaced by the specified value.- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- if eitherkeyorvalueare null
-
putAllStandardMethodUnderrides
public Datatype.Builder putAllStandardMethodUnderrides(java.util.Map<? extends Datatype.StandardMethod,? extends Datatype.UnderrideLevel> map)
Copies all of the mappings frommapto the map to be returned fromDatatype.getStandardMethodUnderrides().- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifmapis null or contains a null key or value
-
removeStandardMethodUnderrides
public Datatype.Builder removeStandardMethodUnderrides(Datatype.StandardMethod key)
Removes the mapping forkeyfrom the map to be returned fromDatatype.getStandardMethodUnderrides(), if one is present.- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifkeyis null
-
mutateStandardMethodUnderrides
public Datatype.Builder mutateStandardMethodUnderrides(java.util.function.Consumer<? super java.util.Map<Datatype.StandardMethod,Datatype.UnderrideLevel>> mutator)
Invokesmutatorwith the map to be returned fromDatatype.getStandardMethodUnderrides().This method mutates the map in-place.
mutatoris a void consumer, so any value returned from a lambda will be ignored. Take care not to call pure functions, likeCollection.stream().- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifmutatoris null
-
clearStandardMethodUnderrides
public Datatype.Builder clearStandardMethodUnderrides()
Removes all of the mappings from the map to be returned fromDatatype.getStandardMethodUnderrides().- Returns:
- this
Builderobject
-
getStandardMethodUnderrides
public java.util.Map<Datatype.StandardMethod,Datatype.UnderrideLevel> getStandardMethodUnderrides()
Returns an unmodifiable view of the map that will be returned byDatatype.getStandardMethodUnderrides(). Changes to this builder will be reflected in the view.
-
setBuilderSerializable
public Datatype.Builder setBuilderSerializable(boolean builderSerializable)
Sets the value to be returned byDatatype.isBuilderSerializable().- Returns:
- this
Builderobject
-
mapBuilderSerializable
public Datatype.Builder mapBuilderSerializable(java.util.function.UnaryOperator<java.lang.Boolean> mapper)
Replaces the value to be returned byDatatype.isBuilderSerializable()by applyingmapperto it and using the result.- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifmapperis null or returns nulljava.lang.IllegalStateException- if the field has not been set
-
isBuilderSerializable
public boolean isBuilderSerializable()
Returns the value that will be returned byDatatype.isBuilderSerializable().- Throws:
java.lang.IllegalStateException- if the field has not been set
-
setHasToBuilderMethod
public Datatype.Builder setHasToBuilderMethod(boolean hasToBuilderMethod)
Sets the value to be returned byDatatype.getHasToBuilderMethod().- Returns:
- this
Builderobject
-
mapHasToBuilderMethod
public Datatype.Builder mapHasToBuilderMethod(java.util.function.UnaryOperator<java.lang.Boolean> mapper)
Replaces the value to be returned byDatatype.getHasToBuilderMethod()by applyingmapperto it and using the result.- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifmapperis null or returns nulljava.lang.IllegalStateException- if the field has not been set
-
getHasToBuilderMethod
public boolean getHasToBuilderMethod()
Returns the value that will be returned byDatatype.getHasToBuilderMethod().- Throws:
java.lang.IllegalStateException- if the field has not been set
-
setBuildMethod
public Datatype.Builder setBuildMethod(NameAndVisibility buildMethod)
Sets the value to be returned byDatatype.getBuildMethod().- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifbuildMethodis null
-
mapBuildMethod
public Datatype.Builder mapBuildMethod(java.util.function.UnaryOperator<NameAndVisibility> mapper)
Replaces the value to be returned byDatatype.getBuildMethod()by applyingmapperto it and using the result.- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifmapperis null or returns nulljava.lang.IllegalStateException- if the field has not been set
-
getBuildMethod
public NameAndVisibility getBuildMethod()
Returns the value that will be returned byDatatype.getBuildMethod().- Throws:
java.lang.IllegalStateException- if the field has not been set
-
setBuildPartialMethod
public Datatype.Builder setBuildPartialMethod(NameAndVisibility buildPartialMethod)
Sets the value to be returned byDatatype.getBuildPartialMethod().- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifbuildPartialMethodis null
-
mapBuildPartialMethod
public Datatype.Builder mapBuildPartialMethod(java.util.function.UnaryOperator<NameAndVisibility> mapper)
Replaces the value to be returned byDatatype.getBuildPartialMethod()by applyingmapperto it and using the result.- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifmapperis null or returns nulljava.lang.IllegalStateException- if the field has not been set
-
getBuildPartialMethod
public NameAndVisibility getBuildPartialMethod()
Returns the value that will be returned byDatatype.getBuildPartialMethod().- Throws:
java.lang.IllegalStateException- if the field has not been set
-
setClearMethod
public Datatype.Builder setClearMethod(NameAndVisibility clearMethod)
Sets the value to be returned byDatatype.getClearMethod().- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifclearMethodis null
-
mapClearMethod
public Datatype.Builder mapClearMethod(java.util.function.UnaryOperator<NameAndVisibility> mapper)
Replaces the value to be returned byDatatype.getClearMethod()by applyingmapperto it and using the result.- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifmapperis null or returns nulljava.lang.IllegalStateException- if the field has not been set
-
getClearMethod
public NameAndVisibility getClearMethod()
Returns the value that will be returned byDatatype.getClearMethod().- Throws:
java.lang.IllegalStateException- if the field has not been set
-
setMergeFromBuilderMethod
public Datatype.Builder setMergeFromBuilderMethod(NameAndVisibility mergeFromBuilderMethod)
Sets the value to be returned byDatatype.getMergeFromBuilderMethod().- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifmergeFromBuilderMethodis null
-
mapMergeFromBuilderMethod
public Datatype.Builder mapMergeFromBuilderMethod(java.util.function.UnaryOperator<NameAndVisibility> mapper)
Replaces the value to be returned byDatatype.getMergeFromBuilderMethod()by applyingmapperto it and using the result.- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifmapperis null or returns nulljava.lang.IllegalStateException- if the field has not been set
-
getMergeFromBuilderMethod
public NameAndVisibility getMergeFromBuilderMethod()
Returns the value that will be returned byDatatype.getMergeFromBuilderMethod().- Throws:
java.lang.IllegalStateException- if the field has not been set
-
setMergeFromValueMethod
public Datatype.Builder setMergeFromValueMethod(NameAndVisibility mergeFromValueMethod)
Sets the value to be returned byDatatype.getMergeFromValueMethod().- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifmergeFromValueMethodis null
-
mapMergeFromValueMethod
public Datatype.Builder mapMergeFromValueMethod(java.util.function.UnaryOperator<NameAndVisibility> mapper)
Replaces the value to be returned byDatatype.getMergeFromValueMethod()by applyingmapperto it and using the result.- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifmapperis null or returns nulljava.lang.IllegalStateException- if the field has not been set
-
getMergeFromValueMethod
public NameAndVisibility getMergeFromValueMethod()
Returns the value that will be returned byDatatype.getMergeFromValueMethod().- Throws:
java.lang.IllegalStateException- if the field has not been set
-
addGeneratedBuilderAnnotations
public Datatype.Builder addGeneratedBuilderAnnotations(Excerpt element)
Addselementto the list to be returned fromDatatype.getGeneratedBuilderAnnotations().- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifelementis null
-
addGeneratedBuilderAnnotations
public Datatype.Builder addGeneratedBuilderAnnotations(Excerpt... elements)
Adds each element ofelementsto the list to be returned fromDatatype.getGeneratedBuilderAnnotations().- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifelementsis null or contains a null element
-
addAllGeneratedBuilderAnnotations
public Datatype.Builder addAllGeneratedBuilderAnnotations(java.util.Spliterator<? extends Excerpt> elements)
Adds each element ofelementsto the list to be returned fromDatatype.getGeneratedBuilderAnnotations().- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifelementsis null or contains a null element
-
addAllGeneratedBuilderAnnotations
public Datatype.Builder addAllGeneratedBuilderAnnotations(java.util.stream.BaseStream<? extends Excerpt,?> elements)
Adds each element ofelementsto the list to be returned fromDatatype.getGeneratedBuilderAnnotations().- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifelementsis null or contains a null element
-
addAllGeneratedBuilderAnnotations
public Datatype.Builder addAllGeneratedBuilderAnnotations(java.lang.Iterable<? extends Excerpt> elements)
Adds each element ofelementsto the list to be returned fromDatatype.getGeneratedBuilderAnnotations().- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifelementsis null or contains a null element
-
mutateGeneratedBuilderAnnotations
public Datatype.Builder mutateGeneratedBuilderAnnotations(java.util.function.Consumer<? super java.util.List<Excerpt>> mutator)
Appliesmutatorto the list to be returned fromDatatype.getGeneratedBuilderAnnotations().This method mutates the list in-place.
mutatoris a void consumer, so any value returned from a lambda will be ignored. Take care not to call pure functions, likeCollection.stream().- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifmutatoris null
-
clearGeneratedBuilderAnnotations
public Datatype.Builder clearGeneratedBuilderAnnotations()
Clears the list to be returned fromDatatype.getGeneratedBuilderAnnotations().- Returns:
- this
Builderobject
-
getGeneratedBuilderAnnotations
public java.util.List<Excerpt> getGeneratedBuilderAnnotations()
Returns an unmodifiable view of the list that will be returned byDatatype.getGeneratedBuilderAnnotations(). Changes to this builder will be reflected in the view.
-
addValueTypeAnnotations
public Datatype.Builder addValueTypeAnnotations(Excerpt element)
Addselementto the list to be returned fromDatatype.getValueTypeAnnotations().- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifelementis null
-
addValueTypeAnnotations
public Datatype.Builder addValueTypeAnnotations(Excerpt... elements)
Adds each element ofelementsto the list to be returned fromDatatype.getValueTypeAnnotations().- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifelementsis null or contains a null element
-
addAllValueTypeAnnotations
public Datatype.Builder addAllValueTypeAnnotations(java.util.Spliterator<? extends Excerpt> elements)
Adds each element ofelementsto the list to be returned fromDatatype.getValueTypeAnnotations().- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifelementsis null or contains a null element
-
addAllValueTypeAnnotations
public Datatype.Builder addAllValueTypeAnnotations(java.util.stream.BaseStream<? extends Excerpt,?> elements)
Adds each element ofelementsto the list to be returned fromDatatype.getValueTypeAnnotations().- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifelementsis null or contains a null element
-
addAllValueTypeAnnotations
public Datatype.Builder addAllValueTypeAnnotations(java.lang.Iterable<? extends Excerpt> elements)
Adds each element ofelementsto the list to be returned fromDatatype.getValueTypeAnnotations().- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifelementsis null or contains a null element
-
mutateValueTypeAnnotations
public Datatype.Builder mutateValueTypeAnnotations(java.util.function.Consumer<? super java.util.List<Excerpt>> mutator)
Appliesmutatorto the list to be returned fromDatatype.getValueTypeAnnotations().This method mutates the list in-place.
mutatoris a void consumer, so any value returned from a lambda will be ignored. Take care not to call pure functions, likeCollection.stream().- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifmutatoris null
-
clearValueTypeAnnotations
public Datatype.Builder clearValueTypeAnnotations()
Clears the list to be returned fromDatatype.getValueTypeAnnotations().- Returns:
- this
Builderobject
-
getValueTypeAnnotations
public java.util.List<Excerpt> getValueTypeAnnotations()
Returns an unmodifiable view of the list that will be returned byDatatype.getValueTypeAnnotations(). Changes to this builder will be reflected in the view.
-
setValueTypeVisibility
public Datatype.Builder setValueTypeVisibility(Datatype.Visibility valueTypeVisibility)
Sets the value to be returned byDatatype.getValueTypeVisibility().- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifvalueTypeVisibilityis null
-
mapValueTypeVisibility
public Datatype.Builder mapValueTypeVisibility(java.util.function.UnaryOperator<Datatype.Visibility> mapper)
Replaces the value to be returned byDatatype.getValueTypeVisibility()by applyingmapperto it and using the result.- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifmapperis null or returns nulljava.lang.IllegalStateException- if the field has not been set
-
getValueTypeVisibility
public Datatype.Visibility getValueTypeVisibility()
Returns the value that will be returned byDatatype.getValueTypeVisibility().- Throws:
java.lang.IllegalStateException- if the field has not been set
-
addNestedClasses
public Datatype.Builder addNestedClasses(Excerpt element)
Addselementto the list to be returned fromDatatype.getNestedClasses().- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifelementis null
-
addNestedClasses
public Datatype.Builder addNestedClasses(Excerpt... elements)
Adds each element ofelementsto the list to be returned fromDatatype.getNestedClasses().- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifelementsis null or contains a null element
-
addAllNestedClasses
public Datatype.Builder addAllNestedClasses(java.util.Spliterator<? extends Excerpt> elements)
Adds each element ofelementsto the list to be returned fromDatatype.getNestedClasses().- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifelementsis null or contains a null element
-
addAllNestedClasses
public Datatype.Builder addAllNestedClasses(java.util.stream.BaseStream<? extends Excerpt,?> elements)
Adds each element ofelementsto the list to be returned fromDatatype.getNestedClasses().- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifelementsis null or contains a null element
-
addAllNestedClasses
public Datatype.Builder addAllNestedClasses(java.lang.Iterable<? extends Excerpt> elements)
Adds each element ofelementsto the list to be returned fromDatatype.getNestedClasses().- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifelementsis null or contains a null element
-
mutateNestedClasses
public Datatype.Builder mutateNestedClasses(java.util.function.Consumer<? super java.util.List<Excerpt>> mutator)
Appliesmutatorto the list to be returned fromDatatype.getNestedClasses().This method mutates the list in-place.
mutatoris a void consumer, so any value returned from a lambda will be ignored. Take care not to call pure functions, likeCollection.stream().- Returns:
- this
Builderobject - Throws:
java.lang.NullPointerException- ifmutatoris null
-
clearNestedClasses
public Datatype.Builder clearNestedClasses()
Clears the list to be returned fromDatatype.getNestedClasses().- Returns:
- this
Builderobject
-
getNestedClasses
public java.util.List<Excerpt> getNestedClasses()
Returns an unmodifiable view of the list that will be returned byDatatype.getNestedClasses(). Changes to this builder will be reflected in the view.
-
mergeFrom
public Datatype.Builder mergeFrom(Datatype value)
Copies values fromvalue, appending to collections, and skipping empty optionals.- Returns:
- this
Builderobject
-
mergeFrom
public Datatype.Builder mergeFrom(Datatype.Builder template)
Copies values fromtemplate, appending to collections, and skipping empty optionals and unset properties.- Returns:
- this
Builderobject
-
clear
public Datatype.Builder clear()
Resets the state of this builder.- Returns:
- this
Builderobject
-
build
public Datatype build()
Returns a newly-createdDatatypebased on the contents of thisBuilder.- Throws:
java.lang.IllegalStateException- if any field has not been set
-
buildPartial
public Datatype buildPartial()
Returns a newly-created partialDatatypefor use in unit tests. State checking will not be performed. Unset properties will throw anUnsupportedOperationExceptionwhen accessed via the partial object.The builder returned by
from(Datatype)will propagate the partial status of its input, overridingbuild()to return another partial. This allows for robust tests of modify-rebuild code.Partials should only ever be used in tests. They permit writing robust test cases that won't fail if this type gains more application-level constraints (e.g. new required fields) in future. If you require partially complete values in production code, consider using a Builder.
-
-