Package io.dialob.api.form
Class ImmutableForm.Builder
java.lang.Object
io.dialob.api.form.ImmutableForm.Builder
- Enclosing class:
- ImmutableForm
Builds instances of type
ImmutableForm.
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 ImmutableForm.BuilderaddAllValueSets(Iterable<? extends FormValueSet> elements) Adds elements tovalueSetslist.final ImmutableForm.BuilderaddAllVariables(Iterable<? extends Variable> elements) Adds elements tovariableslist.final ImmutableForm.BuilderaddValueSets(FormValueSet element) Adds one element tovalueSetslist.final ImmutableForm.BuilderaddValueSets(FormValueSet... elements) Adds elements tovalueSetslist.final ImmutableForm.BuilderaddVariables(Variable element) Adds one element tovariableslist.final ImmutableForm.BuilderaddVariables(Variable... elements) Adds elements tovariableslist.build()Builds a newImmutableForm.final ImmutableForm.BuilderSets or replaces all mappings from the specified map as entries for thedatamap.final ImmutableForm.BuilderFill a builder with attribute values from the providedForminstance.final ImmutableForm.Builderfrom(ModifiableForm instance) Fill a builder with attribute values from the providedModifiableForminstance.final ImmutableForm.BuilderInitializes the value for theidattribute.final ImmutableForm.Buildermetadata(Form.Metadata metadata) Initializes the value for themetadataattribute.final ImmutableForm.BuilderInitializes the value for thenameattribute.final ImmutableForm.Buildernamespaces(Map<String, ? extends Form> entries) Sets or replaces all mappings from the specified map as entries for thenamespacesmap.final ImmutableForm.BuilderputAllData(Map<String, ? extends FormItem> entries) Put all mappings from the specified map as entries todatamap.final ImmutableForm.BuilderputAllNamespaces(Map<String, ? extends Form> entries) Put all mappings from the specified map as entries tonamespacesmap.final ImmutableForm.BuilderputAllRequiredErrorText(Map<String, ? extends String> entries) Put all mappings from the specified map as entries torequiredErrorTextmap.final ImmutableForm.BuilderPut one entry to thedatamap.final ImmutableForm.BuilderPut one entry to thedatamap.final ImmutableForm.BuilderputNamespaces(String key, Form value) Put one entry to thenamespacesmap.final ImmutableForm.BuilderputNamespaces(Map.Entry<String, ? extends Form> entry) Put one entry to thenamespacesmap.final ImmutableForm.BuilderputRequiredErrorText(String key, String value) Put one entry to therequiredErrorTextmap.final ImmutableForm.BuilderputRequiredErrorText(Map.Entry<String, ? extends String> entry) Put one entry to therequiredErrorTextmap.final ImmutableForm.BuilderrequiredErrorText(Map<String, ? extends String> entries) Sets or replaces all mappings from the specified map as entries for therequiredErrorTextmap.final ImmutableForm.BuilderInitializes the value for therevattribute.final ImmutableForm.BuildervalueSets(Iterable<? extends FormValueSet> elements) Sets or replaces all elements forvalueSetslist.final ImmutableForm.BuilderSets or replaces all elements forvariableslist.
-
Method Details
-
from
Fill a builder with attribute values from the providedModifiableForminstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
Fill a builder with attribute values from the providedForminstance. 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 (can benull)- Returns:
thisbuilder for use in a chained invocation
-
rev
Initializes the value for therevattribute.- Parameters:
rev- The value for rev (can benull)- Returns:
thisbuilder for use in a chained invocation
-
name
Initializes the value for thenameattribute.- Parameters:
name- The value for name (can benull)- Returns:
thisbuilder for use in a chained invocation
-
putData
Put one entry to thedatamap.- Parameters:
key- The key in the data mapvalue- The associated value in the data map- Returns:
thisbuilder for use in a chained invocation
-
putData
Put one entry to thedatamap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
data
Sets or replaces all mappings from the specified map as entries for thedatamap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the data map- Returns:
thisbuilder for use in a chained invocation
-
putAllData
Put all mappings from the specified map as entries todatamap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the data map- Returns:
thisbuilder for use in a chained invocation
-
metadata
Initializes the value for themetadataattribute.- Parameters:
metadata- The value for metadata (can benull)- Returns:
thisbuilder for use in a chained invocation
-
addVariables
Adds one element tovariableslist.- Parameters:
element- A variables element- Returns:
thisbuilder for use in a chained invocation
-
addVariables
Adds elements tovariableslist.- Parameters:
elements- An array of variables elements- Returns:
thisbuilder for use in a chained invocation
-
variables
Sets or replaces all elements forvariableslist.- Parameters:
elements- An iterable of variables elements- Returns:
thisbuilder for use in a chained invocation
-
addAllVariables
Adds elements tovariableslist.- Parameters:
elements- An iterable of variables elements- Returns:
thisbuilder for use in a chained invocation
-
putNamespaces
Put one entry to thenamespacesmap.- Parameters:
key- The key in the namespaces mapvalue- The associated value in the namespaces map- Returns:
thisbuilder for use in a chained invocation
-
putNamespaces
Put one entry to thenamespacesmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
namespaces
Sets or replaces all mappings from the specified map as entries for thenamespacesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the namespaces map- Returns:
thisbuilder for use in a chained invocation
-
putAllNamespaces
Put all mappings from the specified map as entries tonamespacesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the namespaces map- Returns:
thisbuilder for use in a chained invocation
-
addValueSets
Adds one element tovalueSetslist.- Parameters:
element- A valueSets element- Returns:
thisbuilder for use in a chained invocation
-
addValueSets
Adds elements tovalueSetslist.- Parameters:
elements- An array of valueSets elements- Returns:
thisbuilder for use in a chained invocation
-
valueSets
Sets or replaces all elements forvalueSetslist.- Parameters:
elements- An iterable of valueSets elements- Returns:
thisbuilder for use in a chained invocation
-
addAllValueSets
Adds elements tovalueSetslist.- Parameters:
elements- An iterable of valueSets elements- Returns:
thisbuilder for use in a chained invocation
-
putRequiredErrorText
public final ImmutableForm.Builder putRequiredErrorText(@Nullable String key, @Nullable String value) Put one entry to therequiredErrorTextmap.- Parameters:
key- The key in the requiredErrorText mapvalue- The associated value in the requiredErrorText map- Returns:
thisbuilder for use in a chained invocation
-
putRequiredErrorText
Put one entry to therequiredErrorTextmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
requiredErrorText
Sets or replaces all mappings from the specified map as entries for therequiredErrorTextmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the requiredErrorText map- Returns:
thisbuilder for use in a chained invocation
-
putAllRequiredErrorText
Put all mappings from the specified map as entries torequiredErrorTextmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the requiredErrorText map- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableForm.- Returns:
- An immutable instance of Form
- Throws:
IllegalStateException- if any required attributes are missing
-