@NotThreadSafe public static final class ImmutableEventResponse.Builder extends Object
ImmutableEventResponse.
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 |
|---|---|
ImmutableEventResponse.Builder |
addAllEvents(Iterable<? extends Event> elements)
Adds elements to
events list. |
ImmutableEventResponse.Builder |
addEvents(Event... elements)
Adds elements to
events list. |
ImmutableEventResponse.Builder |
addEvents(Event element)
Adds one element to
events list. |
ImmutableEventResponse |
build()
Builds a new
ImmutableEventResponse. |
ImmutableEventResponse.Builder |
events(Iterable<? extends Event> elements)
Sets or replaces all elements for
events list. |
ImmutableEventResponse.Builder |
from(EventResponse instance)
Fill a builder with attribute values from the provided
EventResponse instance. |
ImmutableEventResponse.Builder |
index(BigInteger index)
Initializes the value for the
index attribute. |
@CanIgnoreReturnValue public final ImmutableEventResponse.Builder from(EventResponse instance)
EventResponse 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 ImmutableEventResponse.Builder addEvents(Event element)
events list.element - A events elementthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableEventResponse.Builder addEvents(Event... elements)
events list.elements - An array of events elementsthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableEventResponse.Builder events(Iterable<? extends Event> elements)
events list.elements - An iterable of events elementsthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableEventResponse.Builder addAllEvents(Iterable<? extends Event> elements)
events list.elements - An iterable of events elementsthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableEventResponse.Builder index(BigInteger index)
index attribute.index - The value for indexthis builder for use in a chained invocationpublic ImmutableEventResponse build()
ImmutableEventResponse.IllegalStateException - if any required attributes are missingCopyright © 2019. All rights reserved.