Class ImmutableFormItem
java.lang.Object
io.dialob.session.engine.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 of
FormItem.
Use the builder to create immutable instances:
ImmutableFormItem.builder().
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableFormItem.Builderbuilder()Creates a builder forImmutableFormItem.static ImmutableFormItemCreates an immutable copy of aFormItemvalue.booleanThis instance is equal to all instances ofImmutableFormItemthat have equal attribute values.getId()getProps()getType()getView()inthashCode()Computes a hash code from attributes:isPrototype,id,type,valueType,valueSetId,defaultValue,view,props,className,activeExpression,requiredExpression,disabledExpression,labelExpression,descriptionExpression,errors.booleantoString()Prints the immutable valueFormItemwith attribute values.final ImmutableFormItemwithActiveExpression(Expression value) Copy the current immutable object by setting a present value for the optionalactiveExpressionattribute.final ImmutableFormItemwithActiveExpression(Optional<? extends Expression> optional) Copy the current immutable object by setting an optional value for theactiveExpressionattribute.final ImmutableFormItemwithClassName(Expression value) Copy the current immutable object by setting a present value for the optionalclassNameattribute.final ImmutableFormItemwithClassName(Optional<? extends Expression> optional) Copy the current immutable object by setting an optional value for theclassNameattribute.final ImmutableFormItemwithDefaultValue(Object value) Copy the current immutable object by setting a present value for the optionaldefaultValueattribute.final ImmutableFormItemwithDefaultValue(Optional<? extends Object> optional) Copy the current immutable object by setting an optional value for thedefaultValueattribute.final ImmutableFormItemCopy the current immutable object by setting a present value for the optionaldescriptionExpressionattribute.final ImmutableFormItemwithDescriptionExpression(Optional<? extends Expression> optional) Copy the current immutable object by setting an optional value for thedescriptionExpressionattribute.final ImmutableFormItemwithDisabledExpression(Expression value) Copy the current immutable object by setting a present value for the optionaldisabledExpressionattribute.final ImmutableFormItemwithDisabledExpression(Optional<? extends Expression> optional) Copy the current immutable object by setting an optional value for thedisabledExpressionattribute.final ImmutableFormItemwithErrors(Error... elements) Copy the current immutable object with elements that replace the content oferrors.final ImmutableFormItemwithErrors(Iterable<? extends Error> elements) Copy the current immutable object with elements that replace the content oferrors.final ImmutableFormItemCopy the current immutable object by setting a value for theidattribute.final ImmutableFormItemwithIsPrototype(boolean value) Copy the current immutable object by setting a value for theisPrototypeattribute.final ImmutableFormItemwithLabelExpression(Expression value) Copy the current immutable object by setting a present value for the optionallabelExpressionattribute.final ImmutableFormItemwithLabelExpression(Optional<? extends Expression> optional) Copy the current immutable object by setting an optional value for thelabelExpressionattribute.final ImmutableFormItemCopy the current immutable object by replacing thepropsmap with the specified map.final ImmutableFormItemwithRequiredExpression(Expression value) Copy the current immutable object by setting a present value for the optionalrequiredExpressionattribute.final ImmutableFormItemwithRequiredExpression(Optional<? extends Expression> optional) Copy the current immutable object by setting an optional value for therequiredExpressionattribute.final ImmutableFormItemCopy the current immutable object by setting a value for thetypeattribute.final ImmutableFormItemwithValueSetId(String value) Copy the current immutable object by setting a present value for the optionalvalueSetIdattribute.final ImmutableFormItemwithValueSetId(Optional<String> optional) Copy the current immutable object by setting an optional value for thevalueSetIdattribute.final ImmutableFormItemwithValueType(ValueType value) Copy the current immutable object by setting a value for thevalueTypeattribute.final ImmutableFormItemCopy the current immutable object by setting a value for theviewattribute.
-
Method Details
-
isPrototype
public boolean isPrototype()- Specified by:
isPrototypein interfaceStructuralNode- Returns:
- The value of the
isPrototypeattribute
-
getId
-
getType
-
getValueType
- Specified by:
getValueTypein interfaceItem- Returns:
- The value of the
valueTypeattribute
-
getValueSetId
- Specified by:
getValueSetIdin interfaceItem- Returns:
- The value of the
valueSetIdattribute
-
getDefaultValue
- Specified by:
getDefaultValuein interfaceItem- Returns:
- The value of the
defaultValueattribute
-
getView
- Specified by:
getViewin interfaceDisplayItem- Returns:
- The value of the
viewattribute
-
getProps
- Specified by:
getPropsin interfaceDisplayItem- Returns:
- The value of the
propsattribute
-
getClassName
- Specified by:
getClassNamein interfaceDisplayItem- Returns:
- The value of the
classNameattribute
-
getActiveExpression
- Specified by:
getActiveExpressionin interfaceDisplayItem- Returns:
- The value of the
activeExpressionattribute
-
getRequiredExpression
- Specified by:
getRequiredExpressionin interfaceDisplayItem- Returns:
- The value of the
requiredExpressionattribute
-
getDisabledExpression
- Specified by:
getDisabledExpressionin interfaceDisplayItem- Returns:
- The value of the
disabledExpressionattribute
-
getLabelExpression
- Specified by:
getLabelExpressionin interfaceDisplayItem- Returns:
- The value of the
labelExpressionattribute
-
getDescriptionExpression
- Specified by:
getDescriptionExpressionin interfaceDisplayItem- Returns:
- The value of the
descriptionExpressionattribute
-
getErrors
- Specified by:
getErrorsin interfaceDisplayItem- Returns:
- The value of the
errorsattribute
-
withIsPrototype
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Prints the immutable valueFormItemwith attribute values. -
copyOf
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
Creates a builder forImmutableFormItem.ImmutableFormItem.builder() .isPrototype(boolean) // optionalisPrototype.id(io.dialob.session.engine.session.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.session.engine.program.model.Expression) // optionalclassName.activeExpression(io.dialob.session.engine.program.model.Expression) // optionalactiveExpression.requiredExpression(io.dialob.session.engine.program.model.Expression) // optionalrequiredExpression.disabledExpression(io.dialob.session.engine.program.model.Expression) // optionaldisabledExpression.labelExpression(io.dialob.session.engine.program.model.Expression) // optionallabelExpression.descriptionExpression(io.dialob.session.engine.program.model.Expression) // optionaldescriptionExpression.addErrors|addAllErrors(io.dialob.session.engine.program.model.Error) //errorselements .build();- Returns:
- A new ImmutableFormItem builder
-