Package io.dialob.program.model
Class ImmutableError
- java.lang.Object
-
- io.dialob.program.model.ImmutableError
-
- All Implemented Interfaces:
Error,ProgramNode,StructuralNode,Serializable
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableError extends Object implements Error
Immutable implementation ofError.Use the builder to create immutable instances:
ImmutableError.builder().- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableError.BuilderBuilds instances of typeImmutableError.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableError.Builderbuilder()Creates a builder forImmutableError.static ImmutableErrorcopyOf(Error instance)Creates an immutable copy of aErrorvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableErrorthat have equal attribute values.StringgetCode()Optional<Expression>getDisabledExpression()ItemIdgetItemId()ExpressiongetLabel()ExpressiongetValidationExpression()inthashCode()Computes a hash code from attributes:isPrototype,code,itemId,validationExpression,disabledExpression,label.booleanisPrototype()StringtoString()Prints the immutable valueErrorwith attribute values.ImmutableErrorwithCode(String value)Copy the current immutable object by setting a value for thecodeattribute.ImmutableErrorwithDisabledExpression(Expression value)Copy the current immutable object by setting a present value for the optionaldisabledExpressionattribute.ImmutableErrorwithDisabledExpression(Optional<? extends Expression> optional)Copy the current immutable object by setting an optional value for thedisabledExpressionattribute.ImmutableErrorwithIsPrototype(boolean value)Copy the current immutable object by setting a value for theisPrototypeattribute.ImmutableErrorwithItemId(ItemId value)Copy the current immutable object by setting a value for theitemIdattribute.ImmutableErrorwithLabel(Expression value)Copy the current immutable object by setting a value for thelabelattribute.ImmutableErrorwithValidationExpression(Expression value)Copy the current immutable object by setting a value for thevalidationExpressionattribute.
-
-
-
Method Detail
-
isPrototype
public boolean isPrototype()
- Specified by:
isPrototypein interfaceStructuralNode- Returns:
- The value of the
isPrototypeattribute
-
getCode
@Nullable public String getCode()
-
getItemId
public ItemId getItemId()
-
getValidationExpression
public Expression getValidationExpression()
- Specified by:
getValidationExpressionin interfaceError- Returns:
- The value of the
validationExpressionattribute
-
getDisabledExpression
public Optional<Expression> getDisabledExpression()
- Specified by:
getDisabledExpressionin interfaceError- Returns:
- The value of the
disabledExpressionattribute
-
getLabel
@Nullable public Expression getLabel()
-
withIsPrototype
public final ImmutableError 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
-
withCode
public final ImmutableError withCode(@Nullable String value)
Copy the current immutable object by setting a value for thecodeattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for code (can benull)- Returns:
- A modified copy of the
thisobject
-
withItemId
public final ImmutableError withItemId(ItemId value)
Copy the current immutable object by setting a value for theitemIdattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for itemId- Returns:
- A modified copy of the
thisobject
-
withValidationExpression
public final ImmutableError withValidationExpression(Expression value)
Copy the current immutable object by setting a value for thevalidationExpressionattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for validationExpression- Returns:
- A modified copy of the
thisobject
-
withDisabledExpression
public final ImmutableError 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 ImmutableError 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
-
withLabel
public final ImmutableError withLabel(@Nullable Expression value)
Copy the current immutable object by setting a value for thelabelattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for label (can benull)- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableErrorthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:isPrototype,code,itemId,validationExpression,disabledExpression,label.
-
toString
public String toString()
Prints the immutable valueErrorwith attribute values.
-
copyOf
public static ImmutableError copyOf(Error instance)
Creates an immutable copy of aErrorvalue. 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 Error instance
-
builder
public static ImmutableError.Builder builder()
Creates a builder forImmutableError.ImmutableError.builder() .isPrototype(boolean) // optionalisPrototype.code(String | null) // nullablecode.itemId(io.dialob.executor.model.ItemId) // requireditemId.validationExpression(io.dialob.program.model.Expression) // requiredvalidationExpression.disabledExpression(io.dialob.program.model.Expression) // optionaldisabledExpression.label(io.dialob.program.model.Expression | null) // nullablelabel.build();- Returns:
- A new ImmutableError builder
-
-