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