Package io.dialob.api.form
Class ImmutableForm
java.lang.Object
io.dialob.api.form.ImmutableForm
- All Implemented Interfaces:
Form,FormEntity,WithValidation<Form>,Serializable
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
public final class ImmutableForm
extends Object
implements Form
Immutable implementation of
Form.
Use the builder to create immutable instances:
ImmutableForm.builder().
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface io.dialob.api.form.Form
Form.Metadata -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableForm.Builderbuilder()Creates a builder forImmutableForm.static ImmutableFormCreates an immutable copy of aFormvalue.booleanThis instance is equal to all instances ofImmutableFormthat have equal attribute values.getData()getId()getName()getRev()inthashCode()Computes a hash code from attributes:id,rev,name,data,metadata,variables,namespaces,valueSets,requiredErrorText.toString()Prints the immutable valueFormwith attribute values.final ImmutableFormCopy the current immutable object by replacing thedatamap with the specified map.final ImmutableFormCopy the current immutable object by setting a value for theidattribute.final ImmutableFormwithMetadata(Form.Metadata value) Copy the current immutable object by setting a value for themetadataattribute.final ImmutableFormCopy the current immutable object by setting a value for thenameattribute.final ImmutableFormwithNamespaces(Map<String, ? extends Form> entries) Copy the current immutable object by replacing thenamespacesmap with the specified map.final ImmutableFormwithRequiredErrorText(Map<String, ? extends String> entries) Copy the current immutable object by replacing therequiredErrorTextmap with the specified map.final ImmutableFormCopy the current immutable object by setting a value for therevattribute.final ImmutableFormwithValueSets(FormValueSet... elements) Copy the current immutable object with elements that replace the content ofvalueSets.final ImmutableFormwithValueSets(Iterable<? extends FormValueSet> elements) Copy the current immutable object with elements that replace the content ofvalueSets.final ImmutableFormwithVariables(Variable... elements) Copy the current immutable object with elements that replace the content ofvariables.final ImmutableFormwithVariables(Iterable<? extends Variable> elements) Copy the current immutable object with elements that replace the content ofvariables.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
-
getId
-
getRev
-
getName
-
getData
-
getMetadata
- Specified by:
getMetadatain interfaceForm- Returns:
- The value of the
metadataattribute
-
getVariables
- Specified by:
getVariablesin interfaceForm- Returns:
- The value of the
variablesattribute
-
getNamespaces
- Specified by:
getNamespacesin interfaceForm- Returns:
- The value of the
namespacesattribute
-
getValueSets
- Specified by:
getValueSetsin interfaceForm- Returns:
- The value of the
valueSetsattribute
-
getRequiredErrorText
- Specified by:
getRequiredErrorTextin interfaceForm- Returns:
- error text for required fields, unless not defined per item
-
withId
Copy the current immutable object by setting a value for theidattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for id (can benull)- Returns:
- A modified copy of the
thisobject
-
withRev
Copy the current immutable object by setting a value for therevattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for rev (can benull)- Returns:
- A modified copy of the
thisobject
-
withName
Copy the current immutable object by setting a value for thenameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for name (can benull)- Returns:
- A modified copy of the
thisobject
-
withData
Copy the current immutable object by replacing thedatamap with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
entries- The entries to be added to the data map- Returns:
- A modified copy of
thisobject
-
withMetadata
Copy the current immutable object by setting a value for themetadataattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for metadata (can benull)- Returns:
- A modified copy of the
thisobject
-
withVariables
Copy the current immutable object with elements that replace the content ofvariables.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withVariables
Copy the current immutable object with elements that replace the content ofvariables. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of variables elements to set- Returns:
- A modified copy of
thisobject
-
withNamespaces
Copy the current immutable object by replacing thenamespacesmap with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
entries- The entries to be added to the namespaces map- Returns:
- A modified copy of
thisobject
-
withValueSets
Copy the current immutable object with elements that replace the content ofvalueSets.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withValueSets
Copy the current immutable object with elements that replace the content ofvalueSets. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of valueSets elements to set- Returns:
- A modified copy of
thisobject
-
withRequiredErrorText
Copy the current immutable object by replacing therequiredErrorTextmap with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
entries- The entries to be added to the requiredErrorText map- Returns:
- A modified copy of
thisobject
-
equals
This instance is equal to all instances ofImmutableFormthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:id,rev,name,data,metadata,variables,namespaces,valueSets,requiredErrorText. -
toString
Prints the immutable valueFormwith attribute values. -
copyOf
Creates an immutable copy of aFormvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable Form instance
-
builder
Creates a builder forImmutableForm.ImmutableForm.builder() .id(String | null) // nullableid.rev(String | null) // nullablerev.name(String | null) // nullablename.putData|putAllData(String => io.dialob.api.form.FormItem) //datamappings .metadata(io.dialob.api.form.Form.Metadata | null) // nullablemetadata.addVariables|addAllVariables(io.dialob.api.form.Variable) //variableselements .putNamespaces|putAllNamespaces(String => io.dialob.api.form.Form) //namespacesmappings .addValueSets|addAllValueSets(io.dialob.api.form.FormValueSet) //valueSetselements .putRequiredErrorText|putAllRequiredErrorText(String => String) //requiredErrorTextmappings .build();- Returns:
- A new ImmutableForm builder
-