Package io.dialob.api.form
Class ImmutableFormValidationError.Builder
java.lang.Object
io.dialob.api.form.ImmutableFormValidationError.Builder
- Enclosing class:
- ImmutableFormValidationError
Builds instances of type
ImmutableFormValidationError.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newImmutableFormValidationError.endIndex(int endIndex) Initializes the optional valueendIndexto endIndex.Initializes the optional valueendIndexto endIndex.expression(String expression) Initializes the optional valueexpressionto expression.expression(Optional<String> expression) Initializes the optional valueexpressionto expression.from(FormValidationError instance) Fill a builder with attribute values from the providedFormValidationErrorinstance.index(int index) Initializes the optional valueindexto index.Initializes the optional valueindexto index.Initializes the value for theitemIdattribute.level(FormValidationError.Level level) Initializes the value for thelevelattribute.Initializes the value for themessageattribute.startIndex(int startIndex) Initializes the optional valuestartIndexto startIndex.startIndex(Optional<Integer> startIndex) Initializes the optional valuestartIndexto startIndex.type(FormValidationError.Type type) Initializes the value for thetypeattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedFormValidationErrorinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
itemId
Initializes the value for theitemIdattribute.- Parameters:
itemId- The value for itemId (can benull)- Returns:
thisbuilder for use in a chained invocation
-
message
Initializes the value for themessageattribute.- Parameters:
message- The value for message (can benull)- Returns:
thisbuilder for use in a chained invocation
-
level
Initializes the value for thelevelattribute.If not set, this attribute will have a default value as returned by the initializer of
level.- Parameters:
level- The value for level- Returns:
thisbuilder for use in a chained invocation
-
type
Initializes the value for thetypeattribute.- Parameters:
type- The value for type (can benull)- Returns:
thisbuilder for use in a chained invocation
-
expression
Initializes the optional valueexpressionto expression.- Parameters:
expression- The value for expression- Returns:
thisbuilder for chained invocation
-
expression
Initializes the optional valueexpressionto expression.- Parameters:
expression- The value for expression- Returns:
thisbuilder for use in a chained invocation
-
startIndex
Initializes the optional valuestartIndexto startIndex.- Parameters:
startIndex- The value for startIndex- Returns:
thisbuilder for chained invocation
-
startIndex
Initializes the optional valuestartIndexto startIndex.- Parameters:
startIndex- The value for startIndex- Returns:
thisbuilder for use in a chained invocation
-
endIndex
Initializes the optional valueendIndexto endIndex.- Parameters:
endIndex- The value for endIndex- Returns:
thisbuilder for chained invocation
-
endIndex
Initializes the optional valueendIndexto endIndex.- Parameters:
endIndex- The value for endIndex- Returns:
thisbuilder for use in a chained invocation
-
index
Initializes the optional valueindexto index.- Parameters:
index- The value for index- Returns:
thisbuilder for chained invocation
-
index
Initializes the optional valueindexto index.- Parameters:
index- The value for index- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableFormValidationError.- Returns:
- An immutable instance of FormValidationError
- Throws:
IllegalStateException- if any required attributes are missing
-