Package io.dialob.api.form
Class ModifiableForm
java.lang.Object
io.dialob.api.form.ModifiableForm
- All Implemented Interfaces:
Form,FormEntity,WithValidation<Form>,Serializable
@ParametersAreNonnullByDefault
@Generated({"Modifiables.generator","Form"})
@NotThreadSafe
public final class ModifiableForm
extends Object
implements Form
A modifiable implementation of the
Form type.
Use the create() static factory methods to create new instances.
Use the toImmutable() method to convert to canonical immutable instances.
ModifiableForm is not thread-safe
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.dialob.api.form.Form
Form.Metadata -
Method Summary
Modifier and TypeMethodDescriptionaddAllValueSets(Iterable<? extends FormValueSet> elements) Adds elements tovalueSetslist.addAllVariables(Iterable<? extends Variable> elements) Adds elements tovariableslist.addValueSets(FormValueSet element) Adds one element tovalueSetslist.final ModifiableFormaddValueSets(FormValueSet... elements) Adds elements tovalueSetslist.addVariables(Variable element) Adds one element tovariableslist.final ModifiableFormaddVariables(Variable... elements) Adds elements tovariableslist.clear()Clears the object by setting all attributes to their initial values.static ModifiableFormcreate()Construct a modifiable instance ofForm.booleanThis instance is equal to all instances ofModifiableFormthat have equal attribute values.Fill this modifiable instance with attribute values from the providedForminstance.from(ModifiableForm instance) Fill this modifiable instance with attribute values from the providedForminstance.getData()final StringgetId()final Form.Metadatafinal StringgetName()final StringgetRev()final List<FormValueSet>inthashCode()Computes a hash code from attributes:id,rev,name,data,metadata,variables,namespaces,valueSets,requiredErrorText.final booleanReturnstrueif all required attributes are set, indicating that the object is initialized.putAllData(Map<String, ? extends FormItem> entries) Put all mappings from the specified map as entries to thedatamap.putAllNamespaces(Map<String, ? extends Form> entries) Put all mappings from the specified map as entries to thenamespacesmap.putAllRequiredErrorText(Map<String, ? extends String> entries) Put all mappings from the specified map as entries to therequiredErrorTextmap.Put one entry to thedatamap.putNamespaces(String key, Form value) Put one entry to thenamespacesmap.putRequiredErrorText(String key, String value) Put one entry to therequiredErrorTextmap.Sets or replaces all mappings from the specified map as entries for thedatamap.Assigns a value to theidattribute.setMetadata(Form.Metadata metadata) Assigns a value to themetadataattribute.Assigns a value to thenameattribute.setNamespaces(Map<String, ? extends Form> entries) Sets or replaces all mappings from the specified map as entries for thenamespacesmap.setRequiredErrorText(Map<String, ? extends String> entries) Sets or replaces all mappings from the specified map as entries for therequiredErrorTextmap.Assigns a value to therevattribute.setValueSets(Iterable<? extends FormValueSet> elements) Sets or replaces all elements forvalueSetslist.setVariables(Iterable<? extends Variable> elements) Sets or replaces all elements forvariableslist.final ImmutableFormConverts toImmutableForm.toString()Generates a string representation of thisForm.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.dialob.api.validation.WithValidation
validate
-
Method Details
-
create
Construct a modifiable instance ofForm.- Returns:
- A new modifiable instance
-
getId
-
getRev
-
getName
-
getData
-
getMetadata
- Specified by:
getMetadatain interfaceForm- Returns:
- value of
metadataattribute, may benull
-
getVariables
- Specified by:
getVariablesin interfaceForm- Returns:
- modifiable list
variables
-
getNamespaces
- Specified by:
getNamespacesin interfaceForm- Returns:
- value of
namespacesattribute
-
getValueSets
- Specified by:
getValueSetsin interfaceForm- Returns:
- modifiable list
valueSets
-
getRequiredErrorText
- Specified by:
getRequiredErrorTextin interfaceForm- Returns:
- error text for required fields, unless not defined per item
-
clear
Clears the object by setting all attributes to their initial values.- Returns:
thisfor use in a chained invocation
-
from
Fill this modifiable instance with attribute values from the providedForminstance. Regular attribute values will be overridden, i.e. replaced with ones of an instance. Any of the instance's absent optional values will not be copied (will not override current values). Collection elements and entries will be added, not replaced.- Parameters:
instance- The instance from which to copy values- Returns:
thisfor use in a chained invocation
-
from
Fill this modifiable instance with attribute values from the providedForminstance. Regular attribute values will be overridden, i.e. replaced with ones of an instance. Any of the instance's absent optional values will not be copied (will not override current values). Collection elements and entries will be added, not replaced.- Parameters:
instance- The instance from which to copy values- Returns:
thisfor use in a chained invocation
-
setId
Assigns a value to theidattribute.- Parameters:
id- The value for id, can benull- Returns:
thisfor use in a chained invocation
-
setRev
Assigns a value to therevattribute.- Parameters:
rev- The value for rev, can benull- Returns:
thisfor use in a chained invocation
-
setName
Assigns a value to thenameattribute.- Parameters:
name- The value for name, can benull- Returns:
thisfor use in a chained invocation
-
putData
Put one entry to thedatamap.- Parameters:
key- The key in data mapvalue- The associated value in the data map- Returns:
thisfor use in a chained invocation
-
setData
Sets or replaces all mappings from the specified map as entries for thedatamap. Nulls are not permitted as keys or values.- Parameters:
entries- The entries that will be added to the data map- Returns:
thisfor use in a chained invocation
-
putAllData
Put all mappings from the specified map as entries to thedatamap. Nulls are not permitted as keys or values.- Parameters:
entries- to be added to data map- Returns:
thisfor use in a chained invocation
-
setMetadata
Assigns a value to themetadataattribute.- Parameters:
metadata- The value for metadata, can benull- Returns:
thisfor use in a chained invocation
-
addVariables
Adds one element tovariableslist.- Parameters:
element- The variables element- Returns:
thisfor use in a chained invocation
-
addVariables
Adds elements tovariableslist.- Parameters:
elements- An array of variables elements- Returns:
thisfor use in a chained invocation
-
setVariables
Sets or replaces all elements forvariableslist.- Parameters:
elements- An iterable of variables elements- Returns:
thisfor use in a chained invocation
-
addAllVariables
Adds elements tovariableslist.- Parameters:
elements- An iterable of variables elements- Returns:
thisfor use in a chained invocation
-
putNamespaces
Put one entry to thenamespacesmap.- Parameters:
key- The key in namespaces mapvalue- The associated value in the namespaces map- Returns:
thisfor use in a chained invocation
-
setNamespaces
Sets or replaces all mappings from the specified map as entries for thenamespacesmap. Nulls are not permitted as keys or values.- Parameters:
entries- The entries that will be added to the namespaces map- Returns:
thisfor use in a chained invocation
-
putAllNamespaces
Put all mappings from the specified map as entries to thenamespacesmap. Nulls are not permitted as keys or values.- Parameters:
entries- to be added to namespaces map- Returns:
thisfor use in a chained invocation
-
addValueSets
Adds one element tovalueSetslist.- Parameters:
element- The valueSets element- Returns:
thisfor use in a chained invocation
-
addValueSets
Adds elements tovalueSetslist.- Parameters:
elements- An array of valueSets elements- Returns:
thisfor use in a chained invocation
-
setValueSets
Sets or replaces all elements forvalueSetslist.- Parameters:
elements- An iterable of valueSets elements- Returns:
thisfor use in a chained invocation
-
addAllValueSets
Adds elements tovalueSetslist.- Parameters:
elements- An iterable of valueSets elements- Returns:
thisfor use in a chained invocation
-
putRequiredErrorText
Put one entry to therequiredErrorTextmap.- Parameters:
key- The key in requiredErrorText mapvalue- The associated value in the requiredErrorText map- Returns:
thisfor use in a chained invocation
-
setRequiredErrorText
Sets or replaces all mappings from the specified map as entries for therequiredErrorTextmap. Nulls are not permitted as keys or values.- Parameters:
entries- The entries that will be added to the requiredErrorText map- Returns:
thisfor use in a chained invocation
-
putAllRequiredErrorText
Put all mappings from the specified map as entries to therequiredErrorTextmap. Nulls are not permitted as keys or values.- Parameters:
entries- to be added to requiredErrorText map- Returns:
thisfor use in a chained invocation
-
isInitialized
public final boolean isInitialized()Returnstrueif all required attributes are set, indicating that the object is initialized.- Returns:
trueif set
-
toImmutable
Converts toImmutableForm.- Returns:
- An immutable instance of Form
-
equals
This instance is equal to all instances ofModifiableFormthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:id,rev,name,data,metadata,variables,namespaces,valueSets,requiredErrorText. -
toString
Generates a string representation of thisForm. If uninitialized, some attribute values may appear as question marks.
-