Class BuildableType_Builder
java.lang.Object
org.inferred.freebuilder.processor.BuildableType_Builder
- Direct Known Subclasses:
BuildableType.Builder
@Generated("org.inferred.freebuilder.processor.Processor")
abstract class BuildableType_Builder
extends Object
Auto-generated superclass of
BuildableType.Builder, derived from the API of BuildableType.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classprivate static enumprivate static classprivate static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final EnumSet<BuildableType_Builder.Property> private BuilderFactoryprivate Typeprivate BuildableType.MergeBuilderMethodprivate Excerptprivate Type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Returns a newly-createdBuildableTypebased on the contents of thisBuilder.Returns the value that will be returned byBuildableType.builderFactory().builderFactory(BuilderFactory builderFactory) Sets the value to be returned byBuildableType.builderFactory().Returns the value that will be returned byBuildableType.builderType().builderType(Type builderType) Sets the value to be returned byBuildableType.builderType().Returns a newly-created partialBuildableTypefor use in unit tests.clear()Resets the state of this builder.static BuildableType.Builderfrom(BuildableType value) Creates a new builder usingvalueas a template.mapBuilderFactory(UnaryOperator<BuilderFactory> mapper) Replaces the value to be returned byBuildableType.builderFactory()by applyingmapperto it and using the result.mapBuilderType(UnaryOperator<Type> mapper) Replaces the value to be returned byBuildableType.builderType()by applyingmapperto it and using the result.Replaces the value to be returned byBuildableType.mergeBuilder()by applyingmapperto it and using the result.Replaces the value to be returned byBuildableType.partialToBuilder()by applyingmapperto it and using the result.mapSuppressUnchecked(UnaryOperator<Excerpt> mapper) Replaces the value to be returned byBuildableType.suppressUnchecked()by applyingmapperto it and using the result.mapType(UnaryOperator<Type> mapper) Replaces the value to be returned byBuildableType.type()by applyingmapperto it and using the result.Returns the value that will be returned byBuildableType.mergeBuilder().mergeBuilder(BuildableType.MergeBuilderMethod mergeBuilder) Sets the value to be returned byBuildableType.mergeBuilder().mergeFrom(BuildableType value) Copies values fromvalue.mergeFrom(BuildableType.Builder template) Copies values fromtemplate, skipping unset properties.Returns the value that will be returned byBuildableType.partialToBuilder().partialToBuilder(BuildableType.PartialToBuilderMethod partialToBuilder) Sets the value to be returned byBuildableType.partialToBuilder().Returns the value that will be returned byBuildableType.suppressUnchecked().suppressUnchecked(Excerpt suppressUnchecked) Sets the value to be returned byBuildableType.suppressUnchecked().type()Returns the value that will be returned byBuildableType.type().Sets the value to be returned byBuildableType.type().
-
Field Details
-
type
-
builderType
-
mergeBuilder
-
partialToBuilder
-
builderFactory
-
suppressUnchecked
-
_unsetProperties
-
-
Constructor Details
-
BuildableType_Builder
BuildableType_Builder()
-
-
Method Details
-
from
Creates a new builder usingvalueas a template.If
valueis a partial, the builder will return more partials. -
type
Sets the value to be returned byBuildableType.type().- Returns:
- this
Builderobject - Throws:
NullPointerException- iftypeis null
-
mapType
Replaces the value to be returned byBuildableType.type()by applyingmapperto it and using the result.- Returns:
- this
Builderobject - Throws:
NullPointerException- ifmapperis null or returns nullIllegalStateException- if the field has not been set
-
type
Returns the value that will be returned byBuildableType.type().- Throws:
IllegalStateException- if the field has not been set
-
builderType
Sets the value to be returned byBuildableType.builderType().- Returns:
- this
Builderobject - Throws:
NullPointerException- ifbuilderTypeis null
-
mapBuilderType
Replaces the value to be returned byBuildableType.builderType()by applyingmapperto it and using the result.- Returns:
- this
Builderobject - Throws:
NullPointerException- ifmapperis null or returns nullIllegalStateException- if the field has not been set
-
builderType
Returns the value that will be returned byBuildableType.builderType().- Throws:
IllegalStateException- if the field has not been set
-
mergeBuilder
Sets the value to be returned byBuildableType.mergeBuilder().- Returns:
- this
Builderobject - Throws:
NullPointerException- ifmergeBuilderis null
-
mapMergeBuilder
public BuildableType.Builder mapMergeBuilder(UnaryOperator<BuildableType.MergeBuilderMethod> mapper) Replaces the value to be returned byBuildableType.mergeBuilder()by applyingmapperto it and using the result.- Returns:
- this
Builderobject - Throws:
NullPointerException- ifmapperis null or returns nullIllegalStateException- if the field has not been set
-
mergeBuilder
Returns the value that will be returned byBuildableType.mergeBuilder().- Throws:
IllegalStateException- if the field has not been set
-
partialToBuilder
public BuildableType.Builder partialToBuilder(BuildableType.PartialToBuilderMethod partialToBuilder) Sets the value to be returned byBuildableType.partialToBuilder().- Returns:
- this
Builderobject - Throws:
NullPointerException- ifpartialToBuilderis null
-
mapPartialToBuilder
public BuildableType.Builder mapPartialToBuilder(UnaryOperator<BuildableType.PartialToBuilderMethod> mapper) Replaces the value to be returned byBuildableType.partialToBuilder()by applyingmapperto it and using the result.- Returns:
- this
Builderobject - Throws:
NullPointerException- ifmapperis null or returns nullIllegalStateException- if the field has not been set
-
partialToBuilder
Returns the value that will be returned byBuildableType.partialToBuilder().- Throws:
IllegalStateException- if the field has not been set
-
builderFactory
Sets the value to be returned byBuildableType.builderFactory().- Returns:
- this
Builderobject - Throws:
NullPointerException- ifbuilderFactoryis null
-
mapBuilderFactory
Replaces the value to be returned byBuildableType.builderFactory()by applyingmapperto it and using the result.- Returns:
- this
Builderobject - Throws:
NullPointerException- ifmapperis null or returns nullIllegalStateException- if the field has not been set
-
builderFactory
Returns the value that will be returned byBuildableType.builderFactory().- Throws:
IllegalStateException- if the field has not been set
-
suppressUnchecked
Sets the value to be returned byBuildableType.suppressUnchecked().- Returns:
- this
Builderobject - Throws:
NullPointerException- ifsuppressUncheckedis null
-
mapSuppressUnchecked
Replaces the value to be returned byBuildableType.suppressUnchecked()by applyingmapperto it and using the result.- Returns:
- this
Builderobject - Throws:
NullPointerException- ifmapperis null or returns nullIllegalStateException- if the field has not been set
-
suppressUnchecked
Returns the value that will be returned byBuildableType.suppressUnchecked().- Throws:
IllegalStateException- if the field has not been set
-
mergeFrom
Copies values fromvalue.- Returns:
- this
Builderobject
-
mergeFrom
Copies values fromtemplate, skipping unset properties.- Returns:
- this
Builderobject
-
clear
Resets the state of this builder.- Returns:
- this
Builderobject
-
build
Returns a newly-createdBuildableTypebased on the contents of thisBuilder.- Throws:
IllegalStateException- if any field has not been set
-
buildPartial
Returns a newly-created partialBuildableTypefor 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(BuildableType)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.
-