Package io.dialob.api.form
Class ImmutableFormItem.Builder
- java.lang.Object
-
- io.dialob.api.form.ImmutableFormItem.Builder
-
- Enclosing class:
- ImmutableFormItem
@NotThreadSafe public static final class ImmutableFormItem.Builder extends Object
Builds instances of typeImmutableFormItem. 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 ImmutableFormItem.BuilderactiveWhen(String activeWhen)Initializes the value for theactiveWhenattribute.ImmutableFormItem.BuilderaddAllClassName(Iterable<String> elements)Adds elements toclassNamelist.ImmutableFormItem.BuilderaddAllItems(Iterable<String> elements)Adds elements toitemslist.ImmutableFormItem.BuilderaddAllValidations(Iterable<? extends Validation> elements)Adds elements tovalidationslist.ImmutableFormItem.BuilderaddClassName(String element)Adds one element toclassNamelist.ImmutableFormItem.BuilderaddClassName(String... elements)Adds elements toclassNamelist.ImmutableFormItem.BuilderaddItems(String element)Adds one element toitemslist.ImmutableFormItem.BuilderaddItems(String... elements)Adds elements toitemslist.ImmutableFormItem.BuilderadditionalProperties(Map<String,? extends Object> entries)Sets or replaces all mappings from the specified map as entries for theadditionalPropertiesmap.ImmutableFormItem.BuilderaddValidations(Validation element)Adds one element tovalidationslist.ImmutableFormItem.BuilderaddValidations(Validation... elements)Adds elements tovalidationslist.ImmutableFormItembuild()Builds a newImmutableFormItem.ImmutableFormItem.BuildercanAddRowWhen(String canAddRowWhen)Initializes the value for thecanAddRowWhenattribute.ImmutableFormItem.BuildercanRemoveRowWhen(String canRemoveRowWhen)Initializes the value for thecanRemoveRowWhenattribute.ImmutableFormItem.BuilderclassName(Iterable<String> elements)Sets or replaces all elements forclassNamelist.ImmutableFormItem.BuilderdefaultValue(Object defaultValue)Initializes the value for thedefaultValueattribute.ImmutableFormItem.Builderdescription(Map<String,? extends String> entries)Sets or replaces all mappings from the specified map as entries for thedescriptionmap.ImmutableFormItem.Builderfrom(FormItem instance)Fill a builder with attribute values from the providedFormIteminstance.ImmutableFormItem.Builderfrom(ModifiableFormItem instance)Fill a builder with attribute values from the providedModifiableFormIteminstance.ImmutableFormItem.Builderid(String id)Initializes the value for theidattribute.ImmutableFormItem.Builderitems(Iterable<String> elements)Sets or replaces all elements foritemslist.ImmutableFormItem.Builderlabel(Map<String,? extends String> entries)Sets or replaces all mappings from the specified map as entries for thelabelmap.ImmutableFormItem.Builderprops(Map<String,? extends Object> entries)Sets or replaces all mappings from the specified map as entries for thepropsmap.ImmutableFormItem.BuilderputAdditionalProperties(String key, Object value)Put one entry to theadditionalPropertiesmap.ImmutableFormItem.BuilderputAdditionalProperties(Map.Entry<String,? extends Object> entry)Put one entry to theadditionalPropertiesmap.ImmutableFormItem.BuilderputAllAdditionalProperties(Map<String,? extends Object> entries)Put all mappings from the specified map as entries toadditionalPropertiesmap.ImmutableFormItem.BuilderputAllDescription(Map<String,? extends String> entries)Put all mappings from the specified map as entries todescriptionmap.ImmutableFormItem.BuilderputAllLabel(Map<String,? extends String> entries)Put all mappings from the specified map as entries tolabelmap.ImmutableFormItem.BuilderputAllProps(Map<String,? extends Object> entries)Put all mappings from the specified map as entries topropsmap.ImmutableFormItem.BuilderputAllRequiredErrorText(Map<String,? extends String> entries)Put all mappings from the specified map as entries torequiredErrorTextmap.ImmutableFormItem.BuilderputDescription(String key, String value)Put one entry to thedescriptionmap.ImmutableFormItem.BuilderputDescription(Map.Entry<String,? extends String> entry)Put one entry to thedescriptionmap.ImmutableFormItem.BuilderputLabel(String key, String value)Put one entry to thelabelmap.ImmutableFormItem.BuilderputLabel(Map.Entry<String,? extends String> entry)Put one entry to thelabelmap.ImmutableFormItem.BuilderputProps(String key, Object value)Put one entry to thepropsmap.ImmutableFormItem.BuilderputProps(Map.Entry<String,? extends Object> entry)Put one entry to thepropsmap.ImmutableFormItem.BuilderputRequiredErrorText(String key, String value)Put one entry to therequiredErrorTextmap.ImmutableFormItem.BuilderputRequiredErrorText(Map.Entry<String,? extends String> entry)Put one entry to therequiredErrorTextmap.ImmutableFormItem.BuilderreadOnly(Boolean readOnly)Initializes the value for thereadOnlyattribute.ImmutableFormItem.Builderrequired(String required)Initializes the value for therequiredattribute.ImmutableFormItem.BuilderrequiredErrorText(Map<String,? extends String> entries)Sets or replaces all mappings from the specified map as entries for therequiredErrorTextmap.ImmutableFormItem.Buildertype(String type)Initializes the value for thetypeattribute.ImmutableFormItem.Buildervalidations(Iterable<? extends Validation> elements)Sets or replaces all elements forvalidationslist.ImmutableFormItem.BuildervalueSetId(String valueSetId)Initializes the value for thevalueSetIdattribute.ImmutableFormItem.Builderview(String view)Initializes the value for theviewattribute.
-
-
-
Method Detail
-
from
public final ImmutableFormItem.Builder from(ModifiableFormItem instance)
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
public final ImmutableFormItem.Builder from(FormItem instance)
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
public final ImmutableFormItem.Builder id(String id)
Initializes the value for theidattribute.- Parameters:
id- The value for id (can benull)- Returns:
thisbuilder for use in a chained invocation
-
type
public final ImmutableFormItem.Builder type(String type)
Initializes the value for thetypeattribute.- Parameters:
type- The value for type (can benull)- Returns:
thisbuilder for use in a chained invocation
-
view
public final ImmutableFormItem.Builder view(String view)
Initializes the value for theviewattribute.- Parameters:
view- The value for view (can benull)- Returns:
thisbuilder for use in a chained invocation
-
putLabel
public final ImmutableFormItem.Builder putLabel(String key, String value)
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
public final ImmutableFormItem.Builder putLabel(Map.Entry<String,? extends String> entry)
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
public final ImmutableFormItem.Builder label(Map<String,? extends String> entries)
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
public final ImmutableFormItem.Builder putAllLabel(Map<String,? extends String> entries)
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
public final ImmutableFormItem.Builder putDescription(String key, String value)
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
public final ImmutableFormItem.Builder putDescription(Map.Entry<String,? extends String> entry)
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
public final ImmutableFormItem.Builder description(Map<String,? extends String> entries)
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
public final ImmutableFormItem.Builder putAllDescription(Map<String,? extends String> entries)
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
public final ImmutableFormItem.Builder required(String 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(String key, 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
public final ImmutableFormItem.Builder requiredErrorText(Map<String,? extends String> entries)
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
public final ImmutableFormItem.Builder readOnly(Boolean readOnly)
Initializes the value for thereadOnlyattribute.- Parameters:
readOnly- The value for readOnly (can benull)- Returns:
thisbuilder for use in a chained invocation
-
addItems
public final ImmutableFormItem.Builder addItems(@Nullable String element)
Adds one element toitemslist.- Parameters:
element- A items element- Returns:
thisbuilder for use in a chained invocation
-
addItems
public final ImmutableFormItem.Builder addItems(String... elements)
Adds elements toitemslist.- Parameters:
elements- An array of items elements- Returns:
thisbuilder for use in a chained invocation
-
items
public final ImmutableFormItem.Builder items(Iterable<String> elements)
Sets or replaces all elements foritemslist.- Parameters:
elements- An iterable of items elements- Returns:
thisbuilder for use in a chained invocation
-
addAllItems
public final ImmutableFormItem.Builder addAllItems(Iterable<String> elements)
Adds elements toitemslist.- Parameters:
elements- An iterable of items elements- Returns:
thisbuilder for use in a chained invocation
-
addClassName
public final ImmutableFormItem.Builder addClassName(@Nullable String element)
Adds one element toclassNamelist.- Parameters:
element- A className element- Returns:
thisbuilder for use in a chained invocation
-
addClassName
public final ImmutableFormItem.Builder addClassName(String... elements)
Adds elements toclassNamelist.- Parameters:
elements- An array of className elements- Returns:
thisbuilder for use in a chained invocation
-
className
public final ImmutableFormItem.Builder className(Iterable<String> elements)
Sets or replaces all elements forclassNamelist.- Parameters:
elements- An iterable of className elements- Returns:
thisbuilder for use in a chained invocation
-
addAllClassName
public final ImmutableFormItem.Builder addAllClassName(Iterable<String> elements)
Adds elements toclassNamelist.- Parameters:
elements- An iterable of className elements- Returns:
thisbuilder for use in a chained invocation
-
activeWhen
public final ImmutableFormItem.Builder activeWhen(String activeWhen)
Initializes the value for theactiveWhenattribute.- Parameters:
activeWhen- The value for activeWhen (can benull)- Returns:
thisbuilder for use in a chained invocation
-
canAddRowWhen
public final ImmutableFormItem.Builder canAddRowWhen(String canAddRowWhen)
Initializes the value for thecanAddRowWhenattribute.- Parameters:
canAddRowWhen- The value for canAddRowWhen (can benull)- Returns:
thisbuilder for use in a chained invocation
-
canRemoveRowWhen
public final ImmutableFormItem.Builder canRemoveRowWhen(String canRemoveRowWhen)
Initializes the value for thecanRemoveRowWhenattribute.- Parameters:
canRemoveRowWhen- The value for canRemoveRowWhen (can benull)- Returns:
thisbuilder for use in a chained invocation
-
addValidations
public final ImmutableFormItem.Builder addValidations(@Nullable Validation element)
Adds one element tovalidationslist.- Parameters:
element- A validations element- Returns:
thisbuilder for use in a chained invocation
-
addValidations
public final ImmutableFormItem.Builder addValidations(Validation... elements)
Adds elements tovalidationslist.- Parameters:
elements- An array of validations elements- Returns:
thisbuilder for use in a chained invocation
-
validations
public final ImmutableFormItem.Builder validations(Iterable<? extends Validation> elements)
Sets or replaces all elements forvalidationslist.- Parameters:
elements- An iterable of validations elements- Returns:
thisbuilder for use in a chained invocation
-
addAllValidations
public final ImmutableFormItem.Builder addAllValidations(Iterable<? extends Validation> elements)
Adds elements tovalidationslist.- Parameters:
elements- An iterable of validations elements- Returns:
thisbuilder for use in a chained invocation
-
valueSetId
public final ImmutableFormItem.Builder valueSetId(String valueSetId)
Initializes the value for thevalueSetIdattribute.- Parameters:
valueSetId- The value for valueSetId (can benull)- Returns:
thisbuilder for use in a chained invocation
-
defaultValue
public final ImmutableFormItem.Builder defaultValue(Object defaultValue)
Initializes the value for thedefaultValueattribute.- Parameters:
defaultValue- The value for defaultValue (can benull)- Returns:
thisbuilder for use in a chained invocation
-
putProps
public final ImmutableFormItem.Builder putProps(@Nullable String key, @Nullable Object value)
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
public final ImmutableFormItem.Builder putProps(Map.Entry<String,? extends Object> entry)
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
public final ImmutableFormItem.Builder props(Map<String,? extends Object> entries)
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
public final ImmutableFormItem.Builder putAllProps(Map<String,? extends Object> entries)
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
public final ImmutableFormItem.Builder additionalProperties(Map<String,? extends Object> entries)
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
public ImmutableFormItem build()
Builds a newImmutableFormItem.- Returns:
- An immutable instance of FormItem
- Throws:
IllegalStateException- if any required attributes are missing
-
-