Package io.dialob.client.api
Class ImmutableComposerEntity.Builder<A>
- java.lang.Object
-
- io.dialob.client.api.ImmutableComposerEntity.Builder<A>
-
- Enclosing class:
- ImmutableComposerEntity<A>
@NotThreadSafe public static final class ImmutableComposerEntity.Builder<A> extends Object
Builds instances of typeImmutableComposerEntity. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableComposerEntity.Builder<A>addAllErrors(Iterable<? extends io.dialob.api.rest.Response> elements)Adds elements toerrorslist.ImmutableComposerEntity.Builder<A>addErrors(io.dialob.api.rest.Response element)Adds one element toerrorslist.ImmutableComposerEntity.Builder<A>addErrors(io.dialob.api.rest.Response... elements)Adds elements toerrorslist.ImmutableComposerEntity.Builder<A>body(A body)Initializes the value for thebodyattribute.ImmutableComposerEntity<A>build()Builds a newImmutableComposerEntity.ImmutableComposerEntity.Builder<A>errors(Iterable<? extends io.dialob.api.rest.Response> elements)Sets or replaces all elements forerrorslist.ImmutableComposerEntity.Builder<A>from(DialobComposer.ComposerEntity<A> instance)Fill a builder with attribute values from the providedComposerEntityinstance.ImmutableComposerEntity.Builder<A>id(String id)Initializes the value for theidattribute.ImmutableComposerEntity.Builder<A>status(DialobStore.BodyStatus status)Initializes the value for thestatusattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableComposerEntity.Builder<A> from(DialobComposer.ComposerEntity<A> instance)
Fill a builder with attribute values from the providedComposerEntityinstance. 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.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
id
@CanIgnoreReturnValue public final ImmutableComposerEntity.Builder<A> id(String id)
Initializes the value for theidattribute.- Parameters:
id- The value for id- Returns:
thisbuilder for use in a chained invocation
-
body
@CanIgnoreReturnValue public final ImmutableComposerEntity.Builder<A> body(A body)
Initializes the value for thebodyattribute.- Parameters:
body- The value for body- Returns:
thisbuilder for use in a chained invocation
-
addErrors
@CanIgnoreReturnValue public final ImmutableComposerEntity.Builder<A> addErrors(io.dialob.api.rest.Response element)
Adds one element toerrorslist.- Parameters:
element- A errors element- Returns:
thisbuilder for use in a chained invocation
-
addErrors
@CanIgnoreReturnValue public final ImmutableComposerEntity.Builder<A> addErrors(io.dialob.api.rest.Response... elements)
Adds elements toerrorslist.- Parameters:
elements- An array of errors elements- Returns:
thisbuilder for use in a chained invocation
-
errors
@CanIgnoreReturnValue public final ImmutableComposerEntity.Builder<A> errors(Iterable<? extends io.dialob.api.rest.Response> elements)
Sets or replaces all elements forerrorslist.- Parameters:
elements- An iterable of errors elements- Returns:
thisbuilder for use in a chained invocation
-
addAllErrors
@CanIgnoreReturnValue public final ImmutableComposerEntity.Builder<A> addAllErrors(Iterable<? extends io.dialob.api.rest.Response> elements)
Adds elements toerrorslist.- Parameters:
elements- An iterable of errors elements- Returns:
thisbuilder for use in a chained invocation
-
status
@CanIgnoreReturnValue public final ImmutableComposerEntity.Builder<A> status(DialobStore.BodyStatus status)
Initializes the value for thestatusattribute.- Parameters:
status- The value for status- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableComposerEntity<A> build()
Builds a newImmutableComposerEntity.- Returns:
- An immutable instance of ComposerEntity
- Throws:
IllegalStateException- if any required attributes are missing
-
-