Package io.dialob.program.model
Class ImmutableFormItem.Builder
- java.lang.Object
-
- io.dialob.program.model.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.BuilderactiveExpression(Expression activeExpression)Initializes the optional valueactiveExpressionto activeExpression.ImmutableFormItem.BuilderactiveExpression(Optional<? extends Expression> activeExpression)Initializes the optional valueactiveExpressionto activeExpression.ImmutableFormItem.BuilderaddAllErrors(Iterable<? extends Error> elements)Adds elements toerrorslist.ImmutableFormItem.BuilderaddErrors(Error element)Adds one element toerrorslist.ImmutableFormItem.BuilderaddErrors(Error... elements)Adds elements toerrorslist.ImmutableFormItembuild()Builds a newImmutableFormItem.ImmutableFormItem.BuilderclassName(Expression className)Initializes the optional valueclassNameto className.ImmutableFormItem.BuilderclassName(Optional<? extends Expression> className)Initializes the optional valueclassNameto className.ImmutableFormItem.BuilderdefaultValue(Object defaultValue)Initializes the optional valuedefaultValueto defaultValue.ImmutableFormItem.BuilderdefaultValue(Optional<? extends Object> defaultValue)Initializes the optional valuedefaultValueto defaultValue.ImmutableFormItem.BuilderdescriptionExpression(Expression descriptionExpression)Initializes the optional valuedescriptionExpressionto descriptionExpression.ImmutableFormItem.BuilderdescriptionExpression(Optional<? extends Expression> descriptionExpression)Initializes the optional valuedescriptionExpressionto descriptionExpression.ImmutableFormItem.BuilderdisabledExpression(Expression disabledExpression)Initializes the optional valuedisabledExpressionto disabledExpression.ImmutableFormItem.BuilderdisabledExpression(Optional<? extends Expression> disabledExpression)Initializes the optional valuedisabledExpressionto disabledExpression.ImmutableFormItem.Buildererrors(Iterable<? extends Error> elements)Sets or replaces all elements forerrorslist.ImmutableFormItem.Builderfrom(DisplayItem instance)Fill a builder with attribute values from the providedio.dialob.program.model.DisplayIteminstance.ImmutableFormItem.Builderfrom(FormItem instance)Fill a builder with attribute values from the providedio.dialob.program.model.FormIteminstance.ImmutableFormItem.Builderfrom(Item instance)Fill a builder with attribute values from the providedio.dialob.program.model.Iteminstance.ImmutableFormItem.Builderfrom(StructuralNode instance)Fill a builder with attribute values from the providedio.dialob.program.model.StructuralNodeinstance.ImmutableFormItem.Builderid(ItemId id)Initializes the value for theidattribute.ImmutableFormItem.BuilderisPrototype(boolean isPrototype)Initializes the value for theisPrototypeattribute.ImmutableFormItem.BuilderlabelExpression(Expression labelExpression)Initializes the optional valuelabelExpressionto labelExpression.ImmutableFormItem.BuilderlabelExpression(Optional<? extends Expression> labelExpression)Initializes the optional valuelabelExpressionto labelExpression.ImmutableFormItem.Builderprops(@Nullable Map<String,? extends Object> entries)Sets or replaces all mappings from the specified map as entries for thepropsmap.ImmutableFormItem.BuilderputAllProps(Map<String,? extends Object> entries)Put all mappings from the specified map as entries topropsmap.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.BuilderrequiredExpression(Expression requiredExpression)Initializes the optional valuerequiredExpressionto requiredExpression.ImmutableFormItem.BuilderrequiredExpression(Optional<? extends Expression> requiredExpression)Initializes the optional valuerequiredExpressionto requiredExpression.ImmutableFormItem.Buildertype(String type)Initializes the value for thetypeattribute.ImmutableFormItem.BuildervalueSetId(String valueSetId)Initializes the optional valuevalueSetIdto valueSetId.ImmutableFormItem.BuildervalueSetId(Optional<String> valueSetId)Initializes the optional valuevalueSetIdto valueSetId.ImmutableFormItem.BuildervalueType(ValueType valueType)Initializes the value for thevalueTypeattribute.ImmutableFormItem.Builderview(@Nullable String view)Initializes the value for theviewattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableFormItem.Builder from(StructuralNode instance)
Fill a builder with attribute values from the providedio.dialob.program.model.StructuralNodeinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final ImmutableFormItem.Builder from(Item instance)
Fill a builder with attribute values from the providedio.dialob.program.model.Iteminstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final ImmutableFormItem.Builder from(DisplayItem instance)
Fill a builder with attribute values from the providedio.dialob.program.model.DisplayIteminstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final ImmutableFormItem.Builder from(FormItem instance)
Fill a builder with attribute values from the providedio.dialob.program.model.FormIteminstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
isPrototype
@CanIgnoreReturnValue public final ImmutableFormItem.Builder isPrototype(boolean isPrototype)
Initializes the value for theisPrototypeattribute.If not set, this attribute will have a default value as returned by the initializer of
isPrototype.- Parameters:
isPrototype- The value for isPrototype- Returns:
thisbuilder for use in a chained invocation
-
id
@CanIgnoreReturnValue public final ImmutableFormItem.Builder id(ItemId id)
Initializes the value for theidattribute.- Parameters:
id- The value for id- Returns:
thisbuilder for use in a chained invocation
-
type
@CanIgnoreReturnValue public final ImmutableFormItem.Builder type(String type)
Initializes the value for thetypeattribute.- Parameters:
type- The value for type- Returns:
thisbuilder for use in a chained invocation
-
valueType
@CanIgnoreReturnValue public final ImmutableFormItem.Builder valueType(@Nullable ValueType valueType)
Initializes the value for thevalueTypeattribute.- Parameters:
valueType- The value for valueType (can benull)- Returns:
thisbuilder for use in a chained invocation
-
valueSetId
@CanIgnoreReturnValue public final ImmutableFormItem.Builder valueSetId(String valueSetId)
Initializes the optional valuevalueSetIdto valueSetId.- Parameters:
valueSetId- The value for valueSetId- Returns:
thisbuilder for chained invocation
-
valueSetId
@CanIgnoreReturnValue public final ImmutableFormItem.Builder valueSetId(Optional<String> valueSetId)
Initializes the optional valuevalueSetIdto valueSetId.- Parameters:
valueSetId- The value for valueSetId- Returns:
thisbuilder for use in a chained invocation
-
defaultValue
@CanIgnoreReturnValue public final ImmutableFormItem.Builder defaultValue(Object defaultValue)
Initializes the optional valuedefaultValueto defaultValue.- Parameters:
defaultValue- The value for defaultValue- Returns:
thisbuilder for chained invocation
-
defaultValue
@CanIgnoreReturnValue public final ImmutableFormItem.Builder defaultValue(Optional<? extends Object> defaultValue)
Initializes the optional valuedefaultValueto defaultValue.- Parameters:
defaultValue- The value for defaultValue- Returns:
thisbuilder for use in a chained invocation
-
view
@CanIgnoreReturnValue public final ImmutableFormItem.Builder view(@Nullable @Nullable String view)
Initializes the value for theviewattribute.- Parameters:
view- The value for view (can benull)- Returns:
thisbuilder for use in a chained invocation
-
putProps
@CanIgnoreReturnValue 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
@CanIgnoreReturnValue 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
@CanIgnoreReturnValue public final ImmutableFormItem.Builder props(@Nullable @Nullable 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
@CanIgnoreReturnValue 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
-
className
@CanIgnoreReturnValue public final ImmutableFormItem.Builder className(Expression className)
Initializes the optional valueclassNameto className.- Parameters:
className- The value for className- Returns:
thisbuilder for chained invocation
-
className
@CanIgnoreReturnValue public final ImmutableFormItem.Builder className(Optional<? extends Expression> className)
Initializes the optional valueclassNameto className.- Parameters:
className- The value for className- Returns:
thisbuilder for use in a chained invocation
-
activeExpression
@CanIgnoreReturnValue public final ImmutableFormItem.Builder activeExpression(Expression activeExpression)
Initializes the optional valueactiveExpressionto activeExpression.- Parameters:
activeExpression- The value for activeExpression- Returns:
thisbuilder for chained invocation
-
activeExpression
@CanIgnoreReturnValue public final ImmutableFormItem.Builder activeExpression(Optional<? extends Expression> activeExpression)
Initializes the optional valueactiveExpressionto activeExpression.- Parameters:
activeExpression- The value for activeExpression- Returns:
thisbuilder for use in a chained invocation
-
requiredExpression
@CanIgnoreReturnValue public final ImmutableFormItem.Builder requiredExpression(Expression requiredExpression)
Initializes the optional valuerequiredExpressionto requiredExpression.- Parameters:
requiredExpression- The value for requiredExpression- Returns:
thisbuilder for chained invocation
-
requiredExpression
@CanIgnoreReturnValue public final ImmutableFormItem.Builder requiredExpression(Optional<? extends Expression> requiredExpression)
Initializes the optional valuerequiredExpressionto requiredExpression.- Parameters:
requiredExpression- The value for requiredExpression- Returns:
thisbuilder for use in a chained invocation
-
disabledExpression
@CanIgnoreReturnValue public final ImmutableFormItem.Builder disabledExpression(Expression disabledExpression)
Initializes the optional valuedisabledExpressionto disabledExpression.- Parameters:
disabledExpression- The value for disabledExpression- Returns:
thisbuilder for chained invocation
-
disabledExpression
@CanIgnoreReturnValue public final ImmutableFormItem.Builder disabledExpression(Optional<? extends Expression> disabledExpression)
Initializes the optional valuedisabledExpressionto disabledExpression.- Parameters:
disabledExpression- The value for disabledExpression- Returns:
thisbuilder for use in a chained invocation
-
labelExpression
@CanIgnoreReturnValue public final ImmutableFormItem.Builder labelExpression(Expression labelExpression)
Initializes the optional valuelabelExpressionto labelExpression.- Parameters:
labelExpression- The value for labelExpression- Returns:
thisbuilder for chained invocation
-
labelExpression
@CanIgnoreReturnValue public final ImmutableFormItem.Builder labelExpression(Optional<? extends Expression> labelExpression)
Initializes the optional valuelabelExpressionto labelExpression.- Parameters:
labelExpression- The value for labelExpression- Returns:
thisbuilder for use in a chained invocation
-
descriptionExpression
@CanIgnoreReturnValue public final ImmutableFormItem.Builder descriptionExpression(Expression descriptionExpression)
Initializes the optional valuedescriptionExpressionto descriptionExpression.- Parameters:
descriptionExpression- The value for descriptionExpression- Returns:
thisbuilder for chained invocation
-
descriptionExpression
@CanIgnoreReturnValue public final ImmutableFormItem.Builder descriptionExpression(Optional<? extends Expression> descriptionExpression)
Initializes the optional valuedescriptionExpressionto descriptionExpression.- Parameters:
descriptionExpression- The value for descriptionExpression- Returns:
thisbuilder for use in a chained invocation
-
addErrors
@CanIgnoreReturnValue public final ImmutableFormItem.Builder addErrors(Error element)
Adds one element toerrorslist.- Parameters:
element- A errors element- Returns:
thisbuilder for use in a chained invocation
-
addErrors
@CanIgnoreReturnValue public final ImmutableFormItem.Builder addErrors(Error... elements)
Adds elements toerrorslist.- Parameters:
elements- An array of errors elements- Returns:
thisbuilder for use in a chained invocation
-
errors
@CanIgnoreReturnValue public final ImmutableFormItem.Builder errors(Iterable<? extends Error> elements)
Sets or replaces all elements forerrorslist.- Parameters:
elements- An iterable of errors elements- Returns:
thisbuilder for use in a chained invocation
-
addAllErrors
@CanIgnoreReturnValue public final ImmutableFormItem.Builder addAllErrors(Iterable<? extends Error> elements)
Adds elements toerrorslist.- Parameters:
elements- An iterable of errors elements- 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
-
-