public static final class ImmutableSignature.Builder<T> extends Object
ImmutableSignature.
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 |
|---|---|
ImmutableSignature.Builder<T> |
addAllParameters(Iterable<? extends Parameter<?>> elements)
Adds elements to
parameters list. |
ImmutableSignature.Builder<T> |
addParameters(Parameter<?>... elements)
Adds elements to
parameters list. |
ImmutableSignature.Builder<T> |
addParameters(Parameter<?> element)
Adds one element to
parameters list. |
ImmutableSignature<T> |
build()
Builds a new
ImmutableSignature. |
ImmutableSignature.Builder<T> |
from(Signature<T> instance)
Fill a builder with attribute values from the provided
Signature instance. |
ImmutableSignature.Builder<T> |
isVarArg(boolean isVarArg)
Initializes the value for the
isVarArg attribute. |
ImmutableSignature.Builder<T> |
parameters(Iterable<? extends Parameter<?>> elements)
Sets or replaces all elements for
parameters list. |
public final ImmutableSignature.Builder<T> from(Signature<T> instance)
Signature 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 ImmutableSignature.Builder<T> addParameters(Parameter<?> element)
parameters list.element - A parameters elementthis builder for use in a chained invocation@SafeVarargs public final ImmutableSignature.Builder<T> addParameters(Parameter<?>... elements)
parameters list.elements - An array of parameters elementsthis builder for use in a chained invocationpublic final ImmutableSignature.Builder<T> parameters(Iterable<? extends Parameter<?>> elements)
parameters list.elements - An iterable of parameters elementsthis builder for use in a chained invocationpublic final ImmutableSignature.Builder<T> addAllParameters(Iterable<? extends Parameter<?>> elements)
parameters list.elements - An iterable of parameters elementsthis builder for use in a chained invocationpublic final ImmutableSignature.Builder<T> isVarArg(boolean isVarArg)
isVarArg attribute.
If not set, this attribute will have a default value as returned by the initializer of isVarArg.
isVarArg - The value for isVarArgthis builder for use in a chained invocationpublic ImmutableSignature<T> build()
ImmutableSignature.IllegalStateException - if any required attributes are missingCopyright © 2024. All rights reserved.