Package io.resys.hdes.client.api
Class ImmutableComposerEntity.Builder<A extends AstBody>
java.lang.Object
io.resys.hdes.client.api.ImmutableComposerEntity.Builder<A>
- Enclosing class:
- ImmutableComposerEntity<A extends AstBody>
@NotThreadSafe
public static final class ImmutableComposerEntity.Builder<A extends AstBody>
extends Object
Builds instances of type
ImmutableComposerEntity.
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.
-
Method Summary
Modifier and TypeMethodDescriptionfinal ImmutableComposerEntity.Builder<A>addAllAssociations(Iterable<? extends ProgramEnvir.ProgramAssociation> elements) Adds elements toassociationslist.final ImmutableComposerEntity.Builder<A>addAllErrors(Iterable<? extends ProgramEnvir.ProgramMessage> elements) Adds elements toerrorslist.final ImmutableComposerEntity.Builder<A>addAllWarnings(Iterable<? extends ProgramEnvir.ProgramMessage> elements) Adds elements towarningslist.final ImmutableComposerEntity.Builder<A>Adds one element toassociationslist.final ImmutableComposerEntity.Builder<A>addAssociations(ProgramEnvir.ProgramAssociation... elements) Adds elements toassociationslist.final ImmutableComposerEntity.Builder<A>addErrors(ProgramEnvir.ProgramMessage element) Adds one element toerrorslist.final ImmutableComposerEntity.Builder<A>addErrors(ProgramEnvir.ProgramMessage... elements) Adds elements toerrorslist.final ImmutableComposerEntity.Builder<A>addWarnings(ProgramEnvir.ProgramMessage element) Adds one element towarningslist.final ImmutableComposerEntity.Builder<A>addWarnings(ProgramEnvir.ProgramMessage... elements) Adds elements towarningslist.final ImmutableComposerEntity.Builder<A>associations(Iterable<? extends ProgramEnvir.ProgramAssociation> elements) Sets or replaces all elements forassociationslist.final ImmutableComposerEntity.Builder<A>Initializes the value for theastattribute.build()Builds a newImmutableComposerEntity.final ImmutableComposerEntity.Builder<A>errors(Iterable<? extends ProgramEnvir.ProgramMessage> elements) Sets or replaces all elements forerrorslist.final ImmutableComposerEntity.Builder<A>from(HdesComposer.ComposerEntity<A> instance) Fill a builder with attribute values from the providedComposerEntityinstance.final ImmutableComposerEntity.Builder<A>Initializes the value for theidattribute.final ImmutableComposerEntity.Builder<A>source(AstBody.AstSource source) Initializes the value for thesourceattribute.final ImmutableComposerEntity.Builder<A>status(ProgramEnvir.ProgramStatus status) Initializes the value for thestatusattribute.final ImmutableComposerEntity.Builder<A>warnings(Iterable<? extends ProgramEnvir.ProgramMessage> elements) Sets or replaces all elements forwarningslist.
-
Method Details
-
from
@CanIgnoreReturnValue public final ImmutableComposerEntity.Builder<A> from(HdesComposer.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
Initializes the value for theidattribute.- Parameters:
id- The value for id- Returns:
thisbuilder for use in a chained invocation
-
ast
Initializes the value for theastattribute.- Parameters:
ast- The value for ast (can benull)- Returns:
thisbuilder for use in a chained invocation
-
source
@CanIgnoreReturnValue public final ImmutableComposerEntity.Builder<A> source(AstBody.AstSource source) Initializes the value for thesourceattribute.- Parameters:
source- The value for source- Returns:
thisbuilder for use in a chained invocation
-
addWarnings
@CanIgnoreReturnValue public final ImmutableComposerEntity.Builder<A> addWarnings(ProgramEnvir.ProgramMessage element) Adds one element towarningslist.- Parameters:
element- A warnings element- Returns:
thisbuilder for use in a chained invocation
-
addWarnings
@CanIgnoreReturnValue public final ImmutableComposerEntity.Builder<A> addWarnings(ProgramEnvir.ProgramMessage... elements) Adds elements towarningslist.- Parameters:
elements- An array of warnings elements- Returns:
thisbuilder for use in a chained invocation
-
warnings
@CanIgnoreReturnValue public final ImmutableComposerEntity.Builder<A> warnings(Iterable<? extends ProgramEnvir.ProgramMessage> elements) Sets or replaces all elements forwarningslist.- Parameters:
elements- An iterable of warnings elements- Returns:
thisbuilder for use in a chained invocation
-
addAllWarnings
@CanIgnoreReturnValue public final ImmutableComposerEntity.Builder<A> addAllWarnings(Iterable<? extends ProgramEnvir.ProgramMessage> elements) Adds elements towarningslist.- Parameters:
elements- An iterable of warnings elements- Returns:
thisbuilder for use in a chained invocation
-
addErrors
@CanIgnoreReturnValue public final ImmutableComposerEntity.Builder<A> addErrors(ProgramEnvir.ProgramMessage 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(ProgramEnvir.ProgramMessage... 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 ProgramEnvir.ProgramMessage> 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 ProgramEnvir.ProgramMessage> elements) Adds elements toerrorslist.- Parameters:
elements- An iterable of errors elements- Returns:
thisbuilder for use in a chained invocation
-
addAssociations
@CanIgnoreReturnValue public final ImmutableComposerEntity.Builder<A> addAssociations(ProgramEnvir.ProgramAssociation element) Adds one element toassociationslist.- Parameters:
element- A associations element- Returns:
thisbuilder for use in a chained invocation
-
addAssociations
@CanIgnoreReturnValue public final ImmutableComposerEntity.Builder<A> addAssociations(ProgramEnvir.ProgramAssociation... elements) Adds elements toassociationslist.- Parameters:
elements- An array of associations elements- Returns:
thisbuilder for use in a chained invocation
-
associations
@CanIgnoreReturnValue public final ImmutableComposerEntity.Builder<A> associations(Iterable<? extends ProgramEnvir.ProgramAssociation> elements) Sets or replaces all elements forassociationslist.- Parameters:
elements- An iterable of associations elements- Returns:
thisbuilder for use in a chained invocation
-
addAllAssociations
@CanIgnoreReturnValue public final ImmutableComposerEntity.Builder<A> addAllAssociations(Iterable<? extends ProgramEnvir.ProgramAssociation> elements) Adds elements toassociationslist.- Parameters:
elements- An iterable of associations elements- Returns:
thisbuilder for use in a chained invocation
-
status
@CanIgnoreReturnValue public final ImmutableComposerEntity.Builder<A> status(ProgramEnvir.ProgramStatus status) Initializes the value for thestatusattribute.- Parameters:
status- The value for status- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableComposerEntity.- Returns:
- An immutable instance of ComposerEntity
- Throws:
IllegalStateException- if any required attributes are missing
-