@NotThreadSafe public static final class ImmutableExplanation.Builder extends Object
ImmutableExplanation.
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 |
|---|---|
ImmutableExplanation.Builder |
addAllList(Iterable<? extends Explanation.ExplainValue<?>> elements)
Adds elements to
list list. |
ImmutableExplanation.Builder |
addList(Explanation.ExplainValue<?>... elements)
Adds elements to
list list. |
ImmutableExplanation.Builder |
addList(Explanation.ExplainValue<?> element)
Adds one element to
list list. |
ImmutableExplanation |
build()
Builds a new
ImmutableExplanation. |
ImmutableExplanation.Builder |
from(Explanation instance)
Fill a builder with attribute values from the provided
Explanation instance. |
ImmutableExplanation.Builder |
list(Iterable<? extends Explanation.ExplainValue<?>> elements)
Sets or replaces all elements for
list list. |
@CanIgnoreReturnValue public final ImmutableExplanation.Builder from(Explanation instance)
Explanation 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 invocation@CanIgnoreReturnValue public final ImmutableExplanation.Builder addList(Explanation.ExplainValue<?> element)
list list.element - A list elementthis builder for use in a chained invocation@CanIgnoreReturnValue @SafeVarargs public final ImmutableExplanation.Builder addList(Explanation.ExplainValue<?>... elements)
list list.elements - An array of list elementsthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableExplanation.Builder list(Iterable<? extends Explanation.ExplainValue<?>> elements)
list list.elements - An iterable of list elementsthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableExplanation.Builder addAllList(Iterable<? extends Explanation.ExplainValue<?>> elements)
list list.elements - An iterable of list elementsthis builder for use in a chained invocationpublic ImmutableExplanation build()
ImmutableExplanation.IllegalStateException - if any required attributes are missingCopyright © 2023. All rights reserved.