Interface ErrorContext.Builder
-
- Enclosing interface:
- ErrorContext
public static interface ErrorContext.BuilderA builder for aErrorContext.- Since:
- 2.4.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ErrorContextbuild()Builds the context.ErrorContext.Buildercause(java.lang.Throwable cause)Sets the root cause of the error(s).ErrorContext.Buildererror(Error error)Adds an error to the context.ErrorContext.BuildererrorMessage(java.lang.String message)Adds an error to the context for the given message.ErrorContext.BuildererrorMessages(java.util.List<java.lang.String> errors)Adds errors to the context for the given messages.ErrorContext.Buildererrors(java.util.List<Error> errors)Adds the errors to the context.
-
-
-
Method Detail
-
cause
@NonNull ErrorContext.Builder cause(@Nullable java.lang.Throwable cause)
Sets the root cause of the error(s).- Parameters:
cause- The root cause- Returns:
- This builder instance
-
errorMessage
@NonNull ErrorContext.Builder errorMessage(@NonNull java.lang.String message)
Adds an error to the context for the given message.- Parameters:
message- The message- Returns:
- This builder instance
-
error
@NonNull ErrorContext.Builder error(@NonNull Error error)
Adds an error to the context.- Parameters:
error- The message- Returns:
- This builder instance
-
errorMessages
@NonNull ErrorContext.Builder errorMessages(@NonNull java.util.List<java.lang.String> errors)
Adds errors to the context for the given messages.- Parameters:
errors- The errors- Returns:
- This builder instance
-
errors
@NonNull ErrorContext.Builder errors(@NonNull java.util.List<Error> errors)
Adds the errors to the context.- Parameters:
errors- The errors- Returns:
- This builder instance
-
build
@NonNull ErrorContext build()
Builds the context.- Returns:
- A new context
-
-