Package org.elasticsearch.client
Class ValidationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
java.lang.IllegalArgumentException
org.elasticsearch.client.ValidationException
- All Implemented Interfaces:
Serializable
Encapsulates an accumulation of validation errors
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddValidationError(String error) Add a new validation error to the accumulating validation errorsfinal voidaddValidationErrors(ValidationException exception) Adds validation errors from an existingValidationExceptionto the accumulating validation errorsfinal StringReturns the validation errors accumulatedstatic ValidationExceptionCreatesValidationExceptioninstance initialized with given error messages.static ValidationExceptionwithErrors(List<String> errors) CreatesValidationExceptioninstance initialized with given error messages.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ValidationException
public ValidationException()
-
-
Method Details
-
withError
CreatesValidationExceptioninstance initialized with given error messages.- Parameters:
error- the errors to add- Returns:
ValidationExceptioninstance
-
withErrors
CreatesValidationExceptioninstance initialized with given error messages.- Parameters:
errors- the list of errors to add- Returns:
ValidationExceptioninstance
-
addValidationError
Add a new validation error to the accumulating validation errors- Parameters:
error- the error to add
-
addValidationErrors
Adds validation errors from an existingValidationExceptionto the accumulating validation errors- Parameters:
exception- theValidationExceptionto add errors from
-
validationErrors
Returns the validation errors accumulated -
getMessage
- Overrides:
getMessagein classThrowable
-