Package io.dialob.api.rest
Class ImmutableErrors.Builder
java.lang.Object
io.dialob.api.rest.ImmutableErrors.Builder
- Enclosing class:
- ImmutableErrors
Builds instances of type
ImmutableErrors.
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 TypeMethodDescriptionfinal ImmutableErrors.BuilderaddAllErrors(Iterable<? extends Errors.Error> elements) Adds elements toerrorslist.final ImmutableErrors.BuilderaddErrors(Errors.Error element) Adds one element toerrorslist.final ImmutableErrors.BuilderaddErrors(Errors.Error... elements) Adds elements toerrorslist.build()Builds a newImmutableErrors.final ImmutableErrors.BuilderInitializes the value for theerrorattribute.final ImmutableErrors.Buildererrors(Iterable<? extends Errors.Error> elements) Sets or replaces all elements forerrorslist.final ImmutableErrors.BuilderFill a builder with attribute values from the providedErrorsinstance.final ImmutableErrors.BuilderInitializes the value for themessageattribute.final ImmutableErrors.BuilderInitializes the value for thepathattribute.final ImmutableErrors.BuilderInitializes the value for thestatusattribute.final ImmutableErrors.BuilderInitializes the value for thetimestampattribute.final ImmutableErrors.BuilderInitializes the value for thetraceattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedErrorsinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
timestamp
Initializes the value for thetimestampattribute.If not set, this attribute will have a default value as returned by the initializer of
timestamp.- Parameters:
timestamp- The value for timestamp (can benull)- Returns:
thisbuilder for use in a chained invocation
-
status
Initializes the value for thestatusattribute.- Parameters:
status- The value for status (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
-
message
Initializes the value for themessageattribute.- Parameters:
message- The value for message (can benull)- Returns:
thisbuilder for use in a chained invocation
-
trace
Initializes the value for thetraceattribute.- Parameters:
trace- The value for trace (can benull)- Returns:
thisbuilder for use in a chained invocation
-
path
Initializes the value for thepathattribute.- Parameters:
path- The value for path (can benull)- Returns:
thisbuilder for use in a chained invocation
-
addErrors
Adds one element toerrorslist.- Parameters:
element- A errors element- Returns:
thisbuilder for use in a chained invocation
-
addErrors
Adds elements toerrorslist.- Parameters:
elements- An array of errors elements- Returns:
thisbuilder for use in a chained invocation
-
errors
Sets or replaces all elements forerrorslist.- Parameters:
elements- An iterable of errors elements- Returns:
thisbuilder for use in a chained invocation
-
addAllErrors
Adds elements toerrorslist.- Parameters:
elements- An iterable of errors elements- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableErrors.- Returns:
- An immutable instance of Errors
- Throws:
IllegalStateException- if any required attributes are missing
-