Class ImmutableInitSession.Builder
- java.lang.Object
-
- io.dialob.spring.composer.controllers.ImmutableInitSession.Builder
-
- Enclosing class:
- ImmutableInitSession
@NotThreadSafe public static final class ImmutableInitSession.Builder extends Object
Builds instances of typeImmutableInitSession. 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 ImmutableInitSessionbuild()Builds a newImmutableInitSession.ImmutableInitSession.BuildercontextValues(Map<String,? extends Object> entries)Sets or replaces all mappings from the specified map as entries for thecontextValuesmap.ImmutableInitSession.BuilderformId(String formId)Initializes the value for theformIdattribute.ImmutableInitSession.Builderfrom(DialobComposerServiceController.InitSession instance)Fill a builder with attribute values from the providedInitSessioninstance.ImmutableInitSession.Builderlanguage(String language)Initializes the value for thelanguageattribute.ImmutableInitSession.BuilderputAllContextValues(Map<String,? extends Object> entries)Put all mappings from the specified map as entries tocontextValuesmap.ImmutableInitSession.BuilderputContextValues(String key, Object value)Put one entry to thecontextValuesmap.ImmutableInitSession.BuilderputContextValues(Map.Entry<String,? extends Object> entry)Put one entry to thecontextValuesmap.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableInitSession.Builder from(DialobComposerServiceController.InitSession instance)
Fill a builder with attribute values from the providedInitSessioninstance. 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
-
formId
@CanIgnoreReturnValue public final ImmutableInitSession.Builder formId(String formId)
Initializes the value for theformIdattribute.- Parameters:
formId- The value for formId- Returns:
thisbuilder for use in a chained invocation
-
language
@CanIgnoreReturnValue public final ImmutableInitSession.Builder language(String language)
Initializes the value for thelanguageattribute.- Parameters:
language- The value for language- Returns:
thisbuilder for use in a chained invocation
-
putContextValues
@CanIgnoreReturnValue public final ImmutableInitSession.Builder putContextValues(String key, Object value)
Put one entry to thecontextValuesmap.- Parameters:
key- The key in the contextValues mapvalue- The associated value in the contextValues map- Returns:
thisbuilder for use in a chained invocation
-
putContextValues
@CanIgnoreReturnValue public final ImmutableInitSession.Builder putContextValues(Map.Entry<String,? extends Object> entry)
Put one entry to thecontextValuesmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
contextValues
@CanIgnoreReturnValue public final ImmutableInitSession.Builder contextValues(Map<String,? extends Object> entries)
Sets or replaces all mappings from the specified map as entries for thecontextValuesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the contextValues map- Returns:
thisbuilder for use in a chained invocation
-
putAllContextValues
@CanIgnoreReturnValue public final ImmutableInitSession.Builder putAllContextValues(Map<String,? extends Object> entries)
Put all mappings from the specified map as entries tocontextValuesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the contextValues map- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableInitSession build()
Builds a newImmutableInitSession.- Returns:
- An immutable instance of InitSession
- Throws:
IllegalStateException- if any required attributes are missing
-
-