public static class BuildableType.Builder
extends java.lang.Object
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
BuildableType |
build()
Returns a newly-created
BuildableType based on the contents of this Builder. |
BuilderFactory |
builderFactory()
Returns the value that will be returned by
BuildableType.builderFactory(). |
BuildableType.Builder |
builderFactory(BuilderFactory builderFactory)
Sets the value to be returned by
BuildableType.builderFactory(). |
Type |
builderType()
Returns the value that will be returned by
BuildableType.builderType(). |
BuildableType.Builder |
builderType(Type builderType)
Sets the value to be returned by
BuildableType.builderType(). |
BuildableType |
buildPartial()
Returns a newly-created partial
BuildableType for use in unit tests. |
BuildableType.Builder |
clear()
Resets the state of this builder.
|
static BuildableType.Builder |
from(BuildableType value)
Creates a new builder using
value as a template. |
BuildableType.Builder |
mapBuilderFactory(java.util.function.UnaryOperator<BuilderFactory> mapper)
Replaces the value to be returned by
BuildableType.builderFactory() by applying mapper to it and using the result. |
BuildableType.Builder |
mapBuilderType(java.util.function.UnaryOperator<Type> mapper)
Replaces the value to be returned by
BuildableType.builderType() by applying mapper to it and using the result. |
BuildableType.Builder |
mapMergeBuilder(java.util.function.UnaryOperator<BuildableType.MergeBuilderMethod> mapper)
Replaces the value to be returned by
BuildableType.mergeBuilder() by applying mapper to it and using the result. |
BuildableType.Builder |
mapPartialToBuilder(java.util.function.UnaryOperator<BuildableType.PartialToBuilderMethod> mapper)
Replaces the value to be returned by
BuildableType.partialToBuilder() by applying
mapper to it and using the result. |
BuildableType.Builder |
mapSuppressUnchecked(java.util.function.UnaryOperator<Excerpt> mapper)
Replaces the value to be returned by
BuildableType.suppressUnchecked() by applying
mapper to it and using the result. |
BuildableType.Builder |
mapType(java.util.function.UnaryOperator<Type> mapper)
Replaces the value to be returned by
BuildableType.type() by applying mapper to
it and using the result. |
BuildableType.MergeBuilderMethod |
mergeBuilder()
Returns the value that will be returned by
BuildableType.mergeBuilder(). |
BuildableType.Builder |
mergeBuilder(BuildableType.MergeBuilderMethod mergeBuilder)
Sets the value to be returned by
BuildableType.mergeBuilder(). |
BuildableType.Builder |
mergeFrom(BuildableType.Builder template)
Copies values from
template, skipping unset properties. |
BuildableType.Builder |
mergeFrom(BuildableType value)
Copies values from
value. |
BuildableType.PartialToBuilderMethod |
partialToBuilder()
Returns the value that will be returned by
BuildableType.partialToBuilder(). |
BuildableType.Builder |
partialToBuilder(BuildableType.PartialToBuilderMethod partialToBuilder)
Sets the value to be returned by
BuildableType.partialToBuilder(). |
Excerpt |
suppressUnchecked()
Returns the value that will be returned by
BuildableType.suppressUnchecked(). |
BuildableType.Builder |
suppressUnchecked(Excerpt suppressUnchecked)
Sets the value to be returned by
BuildableType.suppressUnchecked(). |
Type |
type()
Returns the value that will be returned by
BuildableType.type(). |
BuildableType.Builder |
type(Type type)
Sets the value to be returned by
BuildableType.type(). |
public static BuildableType.Builder from(BuildableType value)
value as a template.
If value is a partial, the builder will return more partials.
public BuildableType.Builder type(Type type)
BuildableType.type().Builder objectjava.lang.NullPointerException - if type is nullpublic BuildableType.Builder mapType(java.util.function.UnaryOperator<Type> mapper)
BuildableType.type() by applying mapper to
it and using the result.Builder objectjava.lang.NullPointerException - if mapper is null or returns nulljava.lang.IllegalStateException - if the field has not been setpublic Type type()
BuildableType.type().java.lang.IllegalStateException - if the field has not been setpublic BuildableType.Builder builderType(Type builderType)
BuildableType.builderType().Builder objectjava.lang.NullPointerException - if builderType is nullpublic BuildableType.Builder mapBuilderType(java.util.function.UnaryOperator<Type> mapper)
BuildableType.builderType() by applying mapper to it and using the result.Builder objectjava.lang.NullPointerException - if mapper is null or returns nulljava.lang.IllegalStateException - if the field has not been setpublic Type builderType()
BuildableType.builderType().java.lang.IllegalStateException - if the field has not been setpublic BuildableType.Builder mergeBuilder(BuildableType.MergeBuilderMethod mergeBuilder)
BuildableType.mergeBuilder().Builder objectjava.lang.NullPointerException - if mergeBuilder is nullpublic BuildableType.Builder mapMergeBuilder(java.util.function.UnaryOperator<BuildableType.MergeBuilderMethod> mapper)
BuildableType.mergeBuilder() by applying mapper to it and using the result.Builder objectjava.lang.NullPointerException - if mapper is null or returns nulljava.lang.IllegalStateException - if the field has not been setpublic BuildableType.MergeBuilderMethod mergeBuilder()
BuildableType.mergeBuilder().java.lang.IllegalStateException - if the field has not been setpublic BuildableType.Builder partialToBuilder(BuildableType.PartialToBuilderMethod partialToBuilder)
BuildableType.partialToBuilder().Builder objectjava.lang.NullPointerException - if partialToBuilder is nullpublic BuildableType.Builder mapPartialToBuilder(java.util.function.UnaryOperator<BuildableType.PartialToBuilderMethod> mapper)
BuildableType.partialToBuilder() by applying
mapper to it and using the result.Builder objectjava.lang.NullPointerException - if mapper is null or returns nulljava.lang.IllegalStateException - if the field has not been setpublic BuildableType.PartialToBuilderMethod partialToBuilder()
BuildableType.partialToBuilder().java.lang.IllegalStateException - if the field has not been setpublic BuildableType.Builder builderFactory(BuilderFactory builderFactory)
BuildableType.builderFactory().Builder objectjava.lang.NullPointerException - if builderFactory is nullpublic BuildableType.Builder mapBuilderFactory(java.util.function.UnaryOperator<BuilderFactory> mapper)
BuildableType.builderFactory() by applying mapper to it and using the result.Builder objectjava.lang.NullPointerException - if mapper is null or returns nulljava.lang.IllegalStateException - if the field has not been setpublic BuilderFactory builderFactory()
BuildableType.builderFactory().java.lang.IllegalStateException - if the field has not been setpublic BuildableType.Builder suppressUnchecked(Excerpt suppressUnchecked)
BuildableType.suppressUnchecked().Builder objectjava.lang.NullPointerException - if suppressUnchecked is nullpublic BuildableType.Builder mapSuppressUnchecked(java.util.function.UnaryOperator<Excerpt> mapper)
BuildableType.suppressUnchecked() by applying
mapper to it and using the result.Builder objectjava.lang.NullPointerException - if mapper is null or returns nulljava.lang.IllegalStateException - if the field has not been setpublic Excerpt suppressUnchecked()
BuildableType.suppressUnchecked().java.lang.IllegalStateException - if the field has not been setpublic BuildableType.Builder mergeFrom(BuildableType value)
value.Builder objectpublic BuildableType.Builder mergeFrom(BuildableType.Builder template)
template, skipping unset properties.Builder objectpublic BuildableType.Builder clear()
Builder objectpublic BuildableType build()
BuildableType based on the contents of this Builder.java.lang.IllegalStateException - if any field has not been setpublic BuildableType buildPartial()
BuildableType for use in unit tests. State checking
will not be performed. Unset properties will throw an UnsupportedOperationException
when accessed via the partial object.
The builder returned by BuildableType_Builder.from(BuildableType) will propagate the
partial status of its input, overriding build() 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.