Package io.dialob.api.form
Class ImmutableFormItem.Builder
java.lang.Object
io.dialob.api.form.ImmutableFormItem.Builder
- Enclosing class:
- ImmutableFormItem
Builds instances of type
ImmutableFormItem.
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 TypeMethodDescriptionactiveWhen(String activeWhen) Initializes the value for theactiveWhenattribute.addAllClassName(Iterable<String> elements) Adds elements toclassNamelist.addAllItems(Iterable<String> elements) Adds elements toitemslist.addAllValidations(Iterable<? extends Validation> elements) Adds elements tovalidationslist.addClassName(String element) Adds one element toclassNamelist.addClassName(String... elements) Adds elements toclassNamelist.Adds one element toitemslist.Adds elements toitemslist.additionalProperties(Map<String, ? extends Object> entries) Sets or replaces all mappings from the specified map as entries for theadditionalPropertiesmap.addValidations(Validation element) Adds one element tovalidationslist.addValidations(Validation... elements) Adds elements tovalidationslist.build()Builds a newImmutableFormItem.canAddRowWhen(String canAddRowWhen) Initializes the value for thecanAddRowWhenattribute.canRemoveRowWhen(String canRemoveRowWhen) Initializes the value for thecanRemoveRowWhenattribute.Sets or replaces all elements forclassNamelist.defaultValue(Object defaultValue) Initializes the value for thedefaultValueattribute.description(Map<String, ? extends String> entries) Sets or replaces all mappings from the specified map as entries for thedescriptionmap.Fill a builder with attribute values from the providedFormIteminstance.from(ModifiableFormItem instance) Fill a builder with attribute values from the providedModifiableFormIteminstance.Initializes the value for theidattribute.Sets or replaces all elements foritemslist.Sets or replaces all mappings from the specified map as entries for thelabelmap.Sets or replaces all mappings from the specified map as entries for thepropsmap.putAdditionalProperties(String key, Object value) Put one entry to theadditionalPropertiesmap.putAdditionalProperties(Map.Entry<String, ? extends Object> entry) Put one entry to theadditionalPropertiesmap.putAllAdditionalProperties(Map<String, ? extends Object> entries) Put all mappings from the specified map as entries toadditionalPropertiesmap.putAllDescription(Map<String, ? extends String> entries) Put all mappings from the specified map as entries todescriptionmap.putAllLabel(Map<String, ? extends String> entries) Put all mappings from the specified map as entries tolabelmap.putAllProps(Map<String, ? extends Object> entries) Put all mappings from the specified map as entries topropsmap.putAllRequiredErrorText(Map<String, ? extends String> entries) Put all mappings from the specified map as entries torequiredErrorTextmap.putDescription(String key, String value) Put one entry to thedescriptionmap.putDescription(Map.Entry<String, ? extends String> entry) Put one entry to thedescriptionmap.Put one entry to thelabelmap.Put one entry to thelabelmap.Put one entry to thepropsmap.Put one entry to thepropsmap.putRequiredErrorText(String key, String value) Put one entry to therequiredErrorTextmap.putRequiredErrorText(Map.Entry<String, ? extends String> entry) Put one entry to therequiredErrorTextmap.Initializes the value for thereadOnlyattribute.Initializes the value for therequiredattribute.requiredErrorText(Map<String, ? extends String> entries) Sets or replaces all mappings from the specified map as entries for therequiredErrorTextmap.Initializes the value for thetypeattribute.validations(Iterable<? extends Validation> elements) Sets or replaces all elements forvalidationslist.valueSetId(String valueSetId) Initializes the value for thevalueSetIdattribute.Initializes the value for theviewattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedModifiableFormIteminstance.- 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 providedFormIteminstance. 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
-
type
Initializes the value for thetypeattribute.- Parameters:
type- The value for type (can benull)- Returns:
thisbuilder for use in a chained invocation
-
view
Initializes the value for theviewattribute.- Parameters:
view- The value for view (can benull)- Returns:
thisbuilder for use in a chained invocation
-
putLabel
Put one entry to thelabelmap.- Parameters:
key- The key in the label mapvalue- The associated value in the label map- Returns:
thisbuilder for use in a chained invocation
-
putLabel
Put one entry to thelabelmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
label
Sets or replaces all mappings from the specified map as entries for thelabelmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the label map- Returns:
thisbuilder for use in a chained invocation
-
putAllLabel
Put all mappings from the specified map as entries tolabelmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the label map- Returns:
thisbuilder for use in a chained invocation
-
putDescription
Put one entry to thedescriptionmap.- Parameters:
key- The key in the description mapvalue- The associated value in the description map- Returns:
thisbuilder for use in a chained invocation
-
putDescription
Put one entry to thedescriptionmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
description
Sets or replaces all mappings from the specified map as entries for thedescriptionmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the description map- Returns:
thisbuilder for use in a chained invocation
-
putAllDescription
Put all mappings from the specified map as entries todescriptionmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the description map- Returns:
thisbuilder for use in a chained invocation
-
required
Initializes the value for therequiredattribute.- Parameters:
required- The value for required (can benull)- Returns:
thisbuilder for use in a chained invocation
-
putRequiredErrorText
public final ImmutableFormItem.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
public final ImmutableFormItem.Builder putRequiredErrorText(Map.Entry<String, ? extends String> entry) 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
public final ImmutableFormItem.Builder putAllRequiredErrorText(Map<String, ? extends String> entries) 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
-
readOnly
Initializes the value for thereadOnlyattribute.- Parameters:
readOnly- The value for readOnly (can benull)- Returns:
thisbuilder for use in a chained invocation
-
addItems
Adds one element toitemslist.- Parameters:
element- A items element- Returns:
thisbuilder for use in a chained invocation
-
addItems
Adds elements toitemslist.- Parameters:
elements- An array of items elements- Returns:
thisbuilder for use in a chained invocation
-
items
Sets or replaces all elements foritemslist.- Parameters:
elements- An iterable of items elements- Returns:
thisbuilder for use in a chained invocation
-
addAllItems
Adds elements toitemslist.- Parameters:
elements- An iterable of items elements- Returns:
thisbuilder for use in a chained invocation
-
addClassName
Adds one element toclassNamelist.- Parameters:
element- A className element- Returns:
thisbuilder for use in a chained invocation
-
addClassName
Adds elements toclassNamelist.- Parameters:
elements- An array of className elements- Returns:
thisbuilder for use in a chained invocation
-
className
Sets or replaces all elements forclassNamelist.- Parameters:
elements- An iterable of className elements- Returns:
thisbuilder for use in a chained invocation
-
addAllClassName
Adds elements toclassNamelist.- Parameters:
elements- An iterable of className elements- Returns:
thisbuilder for use in a chained invocation
-
activeWhen
Initializes the value for theactiveWhenattribute.- Parameters:
activeWhen- The value for activeWhen (can benull)- Returns:
thisbuilder for use in a chained invocation
-
canAddRowWhen
Initializes the value for thecanAddRowWhenattribute.- Parameters:
canAddRowWhen- The value for canAddRowWhen (can benull)- Returns:
thisbuilder for use in a chained invocation
-
canRemoveRowWhen
Initializes the value for thecanRemoveRowWhenattribute.- Parameters:
canRemoveRowWhen- The value for canRemoveRowWhen (can benull)- Returns:
thisbuilder for use in a chained invocation
-
addValidations
Adds one element tovalidationslist.- Parameters:
element- A validations element- Returns:
thisbuilder for use in a chained invocation
-
addValidations
Adds elements tovalidationslist.- Parameters:
elements- An array of validations elements- Returns:
thisbuilder for use in a chained invocation
-
validations
Sets or replaces all elements forvalidationslist.- Parameters:
elements- An iterable of validations elements- Returns:
thisbuilder for use in a chained invocation
-
addAllValidations
Adds elements tovalidationslist.- Parameters:
elements- An iterable of validations elements- Returns:
thisbuilder for use in a chained invocation
-
valueSetId
Initializes the value for thevalueSetIdattribute.- Parameters:
valueSetId- The value for valueSetId (can benull)- Returns:
thisbuilder for use in a chained invocation
-
defaultValue
Initializes the value for thedefaultValueattribute.- Parameters:
defaultValue- The value for defaultValue (can benull)- Returns:
thisbuilder for use in a chained invocation
-
putProps
Put one entry to thepropsmap.- Parameters:
key- The key in the props mapvalue- The associated value in the props map- Returns:
thisbuilder for use in a chained invocation
-
putProps
Put one entry to thepropsmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
props
Sets or replaces all mappings from the specified map as entries for thepropsmap. Nulls are not permitted as keys or values, but parameter itself can be null- Parameters:
entries- The entries that will be added to the props map- Returns:
thisbuilder for use in a chained invocation
-
putAllProps
Put all mappings from the specified map as entries topropsmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the props map- Returns:
thisbuilder for use in a chained invocation
-
putAdditionalProperties
public final ImmutableFormItem.Builder putAdditionalProperties(@Nullable String key, @Nullable Object value) Put one entry to theadditionalPropertiesmap.- Parameters:
key- The key in the additionalProperties mapvalue- The associated value in the additionalProperties map- Returns:
thisbuilder for use in a chained invocation
-
putAdditionalProperties
public final ImmutableFormItem.Builder putAdditionalProperties(Map.Entry<String, ? extends Object> entry) Put one entry to theadditionalPropertiesmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
additionalProperties
Sets or replaces all mappings from the specified map as entries for theadditionalPropertiesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the additionalProperties map- Returns:
thisbuilder for use in a chained invocation
-
putAllAdditionalProperties
public final ImmutableFormItem.Builder putAllAdditionalProperties(Map<String, ? extends Object> entries) Put all mappings from the specified map as entries toadditionalPropertiesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the additionalProperties map- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableFormItem.- Returns:
- An immutable instance of FormItem
- Throws:
IllegalStateException- if any required attributes are missing
-