Package io.dialob.client.api
Class ImmutableProgramWrapper.Builder
- java.lang.Object
-
- io.dialob.client.api.ImmutableProgramWrapper.Builder
-
- Enclosing class:
- ImmutableProgramWrapper
@NotThreadSafe public static final class ImmutableProgramWrapper.Builder extends Object
Builds instances of typeImmutableProgramWrapper. 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
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableProgramWrapper.Builder from(DialobClient.ProgramWrapper instance)
Fill a builder with attribute values from the providedProgramWrapperinstance. 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
-
source
@CanIgnoreReturnValue public final ImmutableProgramWrapper.Builder source(DialobStore.StoreEntity source)
Initializes the value for thesourceattribute.- Parameters:
source- The value for source- Returns:
thisbuilder for use in a chained invocation
-
document
@CanIgnoreReturnValue public final ImmutableProgramWrapper.Builder document(DialobDocument.FormDocument document)
Initializes the value for thedocumentattribute.- Parameters:
document- The value for document- Returns:
thisbuilder for use in a chained invocation
-
id
@CanIgnoreReturnValue public final ImmutableProgramWrapper.Builder id(String id)
Initializes the value for theidattribute.- Parameters:
id- The value for id- Returns:
thisbuilder for use in a chained invocation
-
status
@CanIgnoreReturnValue public final ImmutableProgramWrapper.Builder status(DialobClient.ProgramStatus status)
Initializes the value for thestatusattribute.- Parameters:
status- The value for status- Returns:
thisbuilder for use in a chained invocation
-
addErrors
@CanIgnoreReturnValue public final ImmutableProgramWrapper.Builder addErrors(DialobClient.ProgramMessage element)
Adds one element toerrorslist.- Parameters:
element- A errors element- Returns:
thisbuilder for use in a chained invocation
-
addErrors
@CanIgnoreReturnValue public final ImmutableProgramWrapper.Builder addErrors(DialobClient.ProgramMessage... elements)
Adds elements toerrorslist.- Parameters:
elements- An array of errors elements- Returns:
thisbuilder for use in a chained invocation
-
errors
@CanIgnoreReturnValue public final ImmutableProgramWrapper.Builder errors(Iterable<? extends DialobClient.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 ImmutableProgramWrapper.Builder addAllErrors(Iterable<? extends DialobClient.ProgramMessage> elements)
Adds elements toerrorslist.- Parameters:
elements- An iterable of errors elements- Returns:
thisbuilder for use in a chained invocation
-
program
@CanIgnoreReturnValue public final ImmutableProgramWrapper.Builder program(DialobProgram program)
Initializes the optional valueprogramto program.- Parameters:
program- The value for program- Returns:
thisbuilder for chained invocation
-
program
@CanIgnoreReturnValue public final ImmutableProgramWrapper.Builder program(Optional<? extends DialobProgram> program)
Initializes the optional valueprogramto program.- Parameters:
program- The value for program- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableProgramWrapper build()
Builds a newImmutableProgramWrapper.- Returns:
- An immutable instance of ProgramWrapper
- Throws:
IllegalStateException- if any required attributes are missing
-
-