Package io.dialob.program.model
Class ImmutableFormItem
- java.lang.Object
-
- io.dialob.program.model.ImmutableFormItem
-
- All Implemented Interfaces:
DisplayItem,FormItem,Item,ProgramNode,StructuralNode,Serializable
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableFormItem extends Object implements FormItem
Immutable implementation ofFormItem.Use the builder to create immutable instances:
ImmutableFormItem.builder().- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableFormItem.BuilderBuilds instances of typeImmutableFormItem.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableFormItem.Builderbuilder()Creates a builder forImmutableFormItem.static ImmutableFormItemcopyOf(FormItem instance)Creates an immutable copy of aFormItemvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableFormItemthat have equal attribute values.Optional<Expression>getActiveExpression()Optional<Expression>getClassName()Optional<Object>getDefaultValue()Optional<Expression>getDescriptionExpression()Optional<Expression>getDisabledExpression()List<Error>getErrors()ItemIdgetId()Optional<Expression>getLabelExpression()@Nullable Map<String,Object>getProps()Optional<Expression>getRequiredExpression()StringgetType()Optional<String>getValueSetId()ValueTypegetValueType()@Nullable StringgetView()inthashCode()Computes a hash code from attributes:isPrototype,id,type,valueType,valueSetId,defaultValue,view,props,className,activeExpression,requiredExpression,disabledExpression,labelExpression,descriptionExpression,errors.booleanisPrototype()StringtoString()Prints the immutable valueFormItemwith attribute values.ImmutableFormItemwithActiveExpression(Expression value)Copy the current immutable object by setting a present value for the optionalactiveExpressionattribute.ImmutableFormItemwithActiveExpression(Optional<? extends Expression> optional)Copy the current immutable object by setting an optional value for theactiveExpressionattribute.ImmutableFormItemwithClassName(Expression value)Copy the current immutable object by setting a present value for the optionalclassNameattribute.ImmutableFormItemwithClassName(Optional<? extends Expression> optional)Copy the current immutable object by setting an optional value for theclassNameattribute.ImmutableFormItemwithDefaultValue(Object value)Copy the current immutable object by setting a present value for the optionaldefaultValueattribute.ImmutableFormItemwithDefaultValue(Optional<? extends Object> optional)Copy the current immutable object by setting an optional value for thedefaultValueattribute.ImmutableFormItemwithDescriptionExpression(Expression value)Copy the current immutable object by setting a present value for the optionaldescriptionExpressionattribute.ImmutableFormItemwithDescriptionExpression(Optional<? extends Expression> optional)Copy the current immutable object by setting an optional value for thedescriptionExpressionattribute.ImmutableFormItemwithDisabledExpression(Expression value)Copy the current immutable object by setting a present value for the optionaldisabledExpressionattribute.ImmutableFormItemwithDisabledExpression(Optional<? extends Expression> optional)Copy the current immutable object by setting an optional value for thedisabledExpressionattribute.ImmutableFormItemwithErrors(Error... elements)Copy the current immutable object with elements that replace the content oferrors.ImmutableFormItemwithErrors(Iterable<? extends Error> elements)Copy the current immutable object with elements that replace the content oferrors.ImmutableFormItemwithId(ItemId value)Copy the current immutable object by setting a value for theidattribute.ImmutableFormItemwithIsPrototype(boolean value)Copy the current immutable object by setting a value for theisPrototypeattribute.ImmutableFormItemwithLabelExpression(Expression value)Copy the current immutable object by setting a present value for the optionallabelExpressionattribute.ImmutableFormItemwithLabelExpression(Optional<? extends Expression> optional)Copy the current immutable object by setting an optional value for thelabelExpressionattribute.ImmutableFormItemwithProps(@Nullable Map<String,? extends Object> entries)Copy the current immutable object by replacing thepropsmap with the specified map.ImmutableFormItemwithRequiredExpression(Expression value)Copy the current immutable object by setting a present value for the optionalrequiredExpressionattribute.ImmutableFormItemwithRequiredExpression(Optional<? extends Expression> optional)Copy the current immutable object by setting an optional value for therequiredExpressionattribute.ImmutableFormItemwithType(String value)Copy the current immutable object by setting a value for thetypeattribute.ImmutableFormItemwithValueSetId(String value)Copy the current immutable object by setting a present value for the optionalvalueSetIdattribute.ImmutableFormItemwithValueSetId(Optional<String> optional)Copy the current immutable object by setting an optional value for thevalueSetIdattribute.ImmutableFormItemwithValueType(ValueType value)Copy the current immutable object by setting a value for thevalueTypeattribute.ImmutableFormItemwithView(@Nullable String value)Copy the current immutable object by setting a value for theviewattribute.
-
-
-
Method Detail
-
isPrototype
public boolean isPrototype()
- Specified by:
isPrototypein interfaceStructuralNode- Returns:
- The value of the
isPrototypeattribute
-
getId
public ItemId getId()
-
getType
public String getType()
-
getValueType
@Nullable public ValueType getValueType()
- Specified by:
getValueTypein interfaceItem- Returns:
- The value of the
valueTypeattribute
-
getValueSetId
public Optional<String> getValueSetId()
- Specified by:
getValueSetIdin interfaceItem- Returns:
- The value of the
valueSetIdattribute
-
getDefaultValue
public Optional<Object> getDefaultValue()
- Specified by:
getDefaultValuein interfaceItem- Returns:
- The value of the
defaultValueattribute
-
getView
@Nullable public @Nullable String getView()
- Specified by:
getViewin interfaceDisplayItem- Returns:
- The value of the
viewattribute
-
getProps
@Nullable public @Nullable Map<String,Object> getProps()
- Specified by:
getPropsin interfaceDisplayItem- Returns:
- The value of the
propsattribute
-
getClassName
public Optional<Expression> getClassName()
- Specified by:
getClassNamein interfaceDisplayItem- Returns:
- The value of the
classNameattribute
-
getActiveExpression
public Optional<Expression> getActiveExpression()
- Specified by:
getActiveExpressionin interfaceDisplayItem- Returns:
- The value of the
activeExpressionattribute
-
getRequiredExpression
public Optional<Expression> getRequiredExpression()
- Specified by:
getRequiredExpressionin interfaceDisplayItem- Returns:
- The value of the
requiredExpressionattribute
-
getDisabledExpression
public Optional<Expression> getDisabledExpression()
- Specified by:
getDisabledExpressionin interfaceDisplayItem- Returns:
- The value of the
disabledExpressionattribute
-
getLabelExpression
public Optional<Expression> getLabelExpression()
- Specified by:
getLabelExpressionin interfaceDisplayItem- Returns:
- The value of the
labelExpressionattribute
-
getDescriptionExpression
public Optional<Expression> getDescriptionExpression()
- Specified by:
getDescriptionExpressionin interfaceDisplayItem- Returns:
- The value of the
descriptionExpressionattribute
-
getErrors
public List<Error> getErrors()
- Specified by:
getErrorsin interfaceDisplayItem- Returns:
- The value of the
errorsattribute
-
withIsPrototype
public final ImmutableFormItem withIsPrototype(boolean value)
Copy the current immutable object by setting a value for theisPrototypeattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for isPrototype- Returns:
- A modified copy of the
thisobject
-
withId
public final ImmutableFormItem withId(ItemId value)
Copy the current immutable object by setting a value for theidattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for id- Returns:
- A modified copy of the
thisobject
-
withType
public final ImmutableFormItem withType(String value)
Copy the current immutable object by setting a value for thetypeattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for type- Returns:
- A modified copy of the
thisobject
-
withValueType
public final ImmutableFormItem withValueType(@Nullable ValueType value)
Copy the current immutable object by setting a value for thevalueTypeattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for valueType (can benull)- Returns:
- A modified copy of the
thisobject
-
withValueSetId
public final ImmutableFormItem withValueSetId(String value)
Copy the current immutable object by setting a present value for the optionalvalueSetIdattribute.- Parameters:
value- The value for valueSetId- Returns:
- A modified copy of
thisobject
-
withValueSetId
public final ImmutableFormItem withValueSetId(Optional<String> optional)
Copy the current immutable object by setting an optional value for thevalueSetIdattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for valueSetId- Returns:
- A modified copy of
thisobject
-
withDefaultValue
public final ImmutableFormItem withDefaultValue(Object value)
Copy the current immutable object by setting a present value for the optionaldefaultValueattribute.- Parameters:
value- The value for defaultValue- Returns:
- A modified copy of
thisobject
-
withDefaultValue
public final ImmutableFormItem withDefaultValue(Optional<? extends Object> optional)
Copy the current immutable object by setting an optional value for thedefaultValueattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for defaultValue- Returns:
- A modified copy of
thisobject
-
withView
public final ImmutableFormItem withView(@Nullable @Nullable String value)
Copy the current immutable object by setting a value for theviewattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for view (can benull)- Returns:
- A modified copy of the
thisobject
-
withProps
public final ImmutableFormItem withProps(@Nullable @Nullable Map<String,? extends Object> entries)
Copy the current immutable object by replacing thepropsmap 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 props map- Returns:
- A modified copy of
thisobject
-
withClassName
public final ImmutableFormItem withClassName(Expression value)
Copy the current immutable object by setting a present value for the optionalclassNameattribute.- Parameters:
value- The value for className- Returns:
- A modified copy of
thisobject
-
withClassName
public final ImmutableFormItem withClassName(Optional<? extends Expression> optional)
Copy the current immutable object by setting an optional value for theclassNameattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for className- Returns:
- A modified copy of
thisobject
-
withActiveExpression
public final ImmutableFormItem withActiveExpression(Expression value)
Copy the current immutable object by setting a present value for the optionalactiveExpressionattribute.- Parameters:
value- The value for activeExpression- Returns:
- A modified copy of
thisobject
-
withActiveExpression
public final ImmutableFormItem withActiveExpression(Optional<? extends Expression> optional)
Copy the current immutable object by setting an optional value for theactiveExpressionattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for activeExpression- Returns:
- A modified copy of
thisobject
-
withRequiredExpression
public final ImmutableFormItem withRequiredExpression(Expression value)
Copy the current immutable object by setting a present value for the optionalrequiredExpressionattribute.- Parameters:
value- The value for requiredExpression- Returns:
- A modified copy of
thisobject
-
withRequiredExpression
public final ImmutableFormItem withRequiredExpression(Optional<? extends Expression> optional)
Copy the current immutable object by setting an optional value for therequiredExpressionattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for requiredExpression- Returns:
- A modified copy of
thisobject
-
withDisabledExpression
public final ImmutableFormItem withDisabledExpression(Expression value)
Copy the current immutable object by setting a present value for the optionaldisabledExpressionattribute.- Parameters:
value- The value for disabledExpression- Returns:
- A modified copy of
thisobject
-
withDisabledExpression
public final ImmutableFormItem withDisabledExpression(Optional<? extends Expression> optional)
Copy the current immutable object by setting an optional value for thedisabledExpressionattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for disabledExpression- Returns:
- A modified copy of
thisobject
-
withLabelExpression
public final ImmutableFormItem withLabelExpression(Expression value)
Copy the current immutable object by setting a present value for the optionallabelExpressionattribute.- Parameters:
value- The value for labelExpression- Returns:
- A modified copy of
thisobject
-
withLabelExpression
public final ImmutableFormItem withLabelExpression(Optional<? extends Expression> optional)
Copy the current immutable object by setting an optional value for thelabelExpressionattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for labelExpression- Returns:
- A modified copy of
thisobject
-
withDescriptionExpression
public final ImmutableFormItem withDescriptionExpression(Expression value)
Copy the current immutable object by setting a present value for the optionaldescriptionExpressionattribute.- Parameters:
value- The value for descriptionExpression- Returns:
- A modified copy of
thisobject
-
withDescriptionExpression
public final ImmutableFormItem withDescriptionExpression(Optional<? extends Expression> optional)
Copy the current immutable object by setting an optional value for thedescriptionExpressionattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for descriptionExpression- Returns:
- A modified copy of
thisobject
-
withErrors
public final ImmutableFormItem withErrors(Error... elements)
Copy the current immutable object with elements that replace the content oferrors.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withErrors
public final ImmutableFormItem withErrors(Iterable<? extends Error> elements)
Copy the current immutable object with elements that replace the content oferrors. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of errors elements to set- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableFormItemthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:isPrototype,id,type,valueType,valueSetId,defaultValue,view,props,className,activeExpression,requiredExpression,disabledExpression,labelExpression,descriptionExpression,errors.
-
toString
public String toString()
Prints the immutable valueFormItemwith attribute values.
-
copyOf
public static ImmutableFormItem copyOf(FormItem instance)
Creates an immutable copy of aFormItemvalue. 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 FormItem instance
-
builder
public static ImmutableFormItem.Builder builder()
Creates a builder forImmutableFormItem.ImmutableFormItem.builder() .isPrototype(boolean) // optionalisPrototype.id(io.dialob.executor.model.ItemId) // requiredid.type(String) // requiredtype.valueType(io.dialob.rule.parser.api.ValueType | null) // nullablevalueType.valueSetId(String) // optionalvalueSetId.defaultValue(Object) // optionaldefaultValue.view(String | null) // nullableview.props(Map<String, Object> | null) // nullableprops.className(io.dialob.program.model.Expression) // optionalclassName.activeExpression(io.dialob.program.model.Expression) // optionalactiveExpression.requiredExpression(io.dialob.program.model.Expression) // optionalrequiredExpression.disabledExpression(io.dialob.program.model.Expression) // optionaldisabledExpression.labelExpression(io.dialob.program.model.Expression) // optionallabelExpression.descriptionExpression(io.dialob.program.model.Expression) // optionaldescriptionExpression.addErrors|addAllErrors(io.dialob.program.model.Error) //errorselements .build();- Returns:
- A new ImmutableFormItem builder
-
-