public static final class ImmutableParameter.Builder<T> extends Object
ImmutableParameter.
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.
| Modifier and Type | Method and Description |
|---|---|
ImmutableParameter.Builder<T> |
addAllValidators(Iterable<? extends ParameterValidator<T>> elements)
Adds elements to
validators list. |
ImmutableParameter.Builder<T> |
addValidators(ParameterValidator<T>... elements)
Adds elements to
validators list. |
ImmutableParameter.Builder<T> |
addValidators(ParameterValidator<T> element)
Adds one element to
validators list. |
ImmutableParameter<T> |
build()
Builds a new
ImmutableParameter. |
ImmutableParameter.Builder<T> |
from(Parameter<T> instance)
Fill a builder with attribute values from the provided
Parameter instance. |
ImmutableParameter.Builder<T> |
isLazy(boolean isLazy)
Initializes the value for the
isLazy attribute. |
ImmutableParameter.Builder<T> |
type(de.flapdoodle.reflection.TypeInfo<T> type)
Initializes the value for the
type attribute. |
ImmutableParameter.Builder<T> |
validators(Iterable<? extends ParameterValidator<T>> elements)
Sets or replaces all elements for
validators list. |
public final ImmutableParameter.Builder<T> from(Parameter<T> instance)
Parameter instance.
Regular attribute values will be replaced with those from the given instance.
Absent optional values will not replace present values.
Collection elements and entries will be added, not replaced.instance - The instance from which to copy valuesthis builder for use in a chained invocationpublic final ImmutableParameter.Builder<T> type(de.flapdoodle.reflection.TypeInfo<T> type)
type attribute.type - The value for typethis builder for use in a chained invocationpublic final ImmutableParameter.Builder<T> isLazy(boolean isLazy)
isLazy attribute.
If not set, this attribute will have a default value as returned by the initializer of isLazy.
isLazy - The value for isLazythis builder for use in a chained invocationpublic final ImmutableParameter.Builder<T> addValidators(ParameterValidator<T> element)
validators list.element - A validators elementthis builder for use in a chained invocation@SafeVarargs public final ImmutableParameter.Builder<T> addValidators(ParameterValidator<T>... elements)
validators list.elements - An array of validators elementsthis builder for use in a chained invocationpublic final ImmutableParameter.Builder<T> validators(Iterable<? extends ParameterValidator<T>> elements)
validators list.elements - An iterable of validators elementsthis builder for use in a chained invocationpublic final ImmutableParameter.Builder<T> addAllValidators(Iterable<? extends ParameterValidator<T>> elements)
validators list.elements - An iterable of validators elementsthis builder for use in a chained invocationpublic ImmutableParameter<T> build()
ImmutableParameter.IllegalStateException - if any required attributes are missingCopyright © 2024. All rights reserved.