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 the 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 the given
Builder. |
BuildableType.Builder |
mergeFrom(BuildableType value)
Sets all property values using the given
BuildableType as a template. |
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.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)
BuildableType as a template.public BuildableType.Builder mergeFrom(BuildableType.Builder template)
Builder. Does not affect any properties not set on the
input.public BuildableType.Builder clear()
public BuildableType build()
BuildableType based on the contents of the 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.
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.