Package io.dialob.api.rest
Class ImmutableErrors.Error.Builder
java.lang.Object
io.dialob.api.rest.ImmutableErrors.Error.Builder
- Enclosing class:
- ImmutableErrors.Error
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newError.Initializes the value for thecodeattribute.Initializes the value for thecontextattribute.Initializes the value for theerrorattribute.from(Errors.Error instance) Fill a builder with attribute values from the providedErrorinstance.rejectedValue(Object rejectedValue) Initializes the value for therejectedValueattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedErrorinstance. 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
-
code
Initializes the value for thecodeattribute.- Parameters:
code- The value for code (can benull)- Returns:
thisbuilder for use in a chained invocation
-
context
Initializes the value for thecontextattribute.- Parameters:
context- The value for context (can benull)- Returns:
thisbuilder for use in a chained invocation
-
rejectedValue
Initializes the value for therejectedValueattribute.- Parameters:
rejectedValue- The value for rejectedValue (can benull)- Returns:
thisbuilder for use in a chained invocation
-
error
Initializes the value for theerrorattribute.- Parameters:
error- The value for error (can benull)- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newError.- Returns:
- An immutable instance of Error
- Throws:
IllegalStateException- if any required attributes are missing
-