Package io.dialob.client.api
Class ImmutableProgramMessage.Builder
- java.lang.Object
-
- io.dialob.client.api.ImmutableProgramMessage.Builder
-
- Enclosing class:
- ImmutableProgramMessage
@NotThreadSafe public static final class ImmutableProgramMessage.Builder extends Object
Builds instances of typeImmutableProgramMessage. 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 ImmutableProgramMessagebuild()Builds a newImmutableProgramMessage.ImmutableProgramMessage.Builderexception(Exception exception)Initializes the value for theexceptionattribute.ImmutableProgramMessage.Builderfrom(DialobClient.ProgramMessage instance)Fill a builder with attribute values from the providedProgramMessageinstance.ImmutableProgramMessage.Builderid(String id)Initializes the value for theidattribute.ImmutableProgramMessage.Buildermsg(String msg)Initializes the value for themsgattribute.ImmutableProgramMessage.Buildersrc(io.dialob.api.form.FormValidationError src)Initializes the value for thesrcattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableProgramMessage.Builder from(DialobClient.ProgramMessage instance)
Fill a builder with attribute values from the providedProgramMessageinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
id
@CanIgnoreReturnValue public final ImmutableProgramMessage.Builder id(String id)
Initializes the value for theidattribute.- Parameters:
id- The value for id- Returns:
thisbuilder for use in a chained invocation
-
msg
@CanIgnoreReturnValue public final ImmutableProgramMessage.Builder msg(@Nullable String msg)
Initializes the value for themsgattribute.- Parameters:
msg- The value for msg (can benull)- Returns:
thisbuilder for use in a chained invocation
-
src
@CanIgnoreReturnValue public final ImmutableProgramMessage.Builder src(@Nullable io.dialob.api.form.FormValidationError src)
Initializes the value for thesrcattribute.- Parameters:
src- The value for src (can benull)- Returns:
thisbuilder for use in a chained invocation
-
exception
@CanIgnoreReturnValue public final ImmutableProgramMessage.Builder exception(@Nullable Exception exception)
Initializes the value for theexceptionattribute.- Parameters:
exception- The value for exception (can benull)- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableProgramMessage build()
Builds a newImmutableProgramMessage.- Returns:
- An immutable instance of ProgramMessage
- Throws:
IllegalStateException- if any required attributes are missing
-
-