Package io.dialob.program.model
Class ImmutableError.Builder
- java.lang.Object
-
- io.dialob.program.model.ImmutableError.Builder
-
- Enclosing class:
- ImmutableError
@NotThreadSafe public static final class ImmutableError.Builder extends Object
Builds instances of typeImmutableError. 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 ImmutableErrorbuild()Builds a newImmutableError.ImmutableError.Buildercode(String code)Initializes the value for thecodeattribute.ImmutableError.BuilderdisabledExpression(Expression disabledExpression)Initializes the optional valuedisabledExpressionto disabledExpression.ImmutableError.BuilderdisabledExpression(Optional<? extends Expression> disabledExpression)Initializes the optional valuedisabledExpressionto disabledExpression.ImmutableError.Builderfrom(Error instance)Fill a builder with attribute values from the providedio.dialob.program.model.Errorinstance.ImmutableError.Builderfrom(StructuralNode instance)Fill a builder with attribute values from the providedio.dialob.program.model.StructuralNodeinstance.ImmutableError.BuilderisPrototype(boolean isPrototype)Initializes the value for theisPrototypeattribute.ImmutableError.BuilderitemId(ItemId itemId)Initializes the value for theitemIdattribute.ImmutableError.Builderlabel(Expression label)Initializes the value for thelabelattribute.ImmutableError.BuildervalidationExpression(Expression validationExpression)Initializes the value for thevalidationExpressionattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableError.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 ImmutableError.Builder from(Error instance)
Fill a builder with attribute values from the providedio.dialob.program.model.Errorinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
isPrototype
@CanIgnoreReturnValue public final ImmutableError.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
-
code
@CanIgnoreReturnValue public final ImmutableError.Builder code(@Nullable String code)
Initializes the value for thecodeattribute.- Parameters:
code- The value for code (can benull)- Returns:
thisbuilder for use in a chained invocation
-
itemId
@CanIgnoreReturnValue public final ImmutableError.Builder itemId(ItemId itemId)
Initializes the value for theitemIdattribute.- Parameters:
itemId- The value for itemId- Returns:
thisbuilder for use in a chained invocation
-
validationExpression
@CanIgnoreReturnValue public final ImmutableError.Builder validationExpression(Expression validationExpression)
Initializes the value for thevalidationExpressionattribute.- Parameters:
validationExpression- The value for validationExpression- Returns:
thisbuilder for use in a chained invocation
-
disabledExpression
@CanIgnoreReturnValue public final ImmutableError.Builder disabledExpression(Expression disabledExpression)
Initializes the optional valuedisabledExpressionto disabledExpression.- Parameters:
disabledExpression- The value for disabledExpression- Returns:
thisbuilder for chained invocation
-
disabledExpression
@CanIgnoreReturnValue public final ImmutableError.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
-
label
@CanIgnoreReturnValue public final ImmutableError.Builder label(@Nullable Expression label)
Initializes the value for thelabelattribute.- Parameters:
label- The value for label (can benull)- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableError build()
Builds a newImmutableError.- Returns:
- An immutable instance of Error
- Throws:
IllegalStateException- if any required attributes are missing
-
-