Package org.elasticsearch.common
Class ValidationException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- java.lang.IllegalArgumentException
-
- org.elasticsearch.common.ValidationException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ActionRequestValidationException,QueryValidationException
public class ValidationException extends IllegalArgumentException
Encapsulates an accumulation of validation errors- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ValidationException()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddValidationError(String error)Add a new validation error to the accumulating validation errorsvoidaddValidationErrors(Iterable<String> errors)Add a sequence of validation errors to the accumulating validation errorsStringgetMessage()List<String>validationErrors()Returns the validation errors accumulated-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Method Detail
-
addValidationError
public final void addValidationError(String error)
Add a new validation error to the accumulating validation errors- Parameters:
error- the error to add
-
addValidationErrors
public final void addValidationErrors(Iterable<String> errors)
Add a sequence of validation errors to the accumulating validation errors- Parameters:
errors- the errors to add
-
validationErrors
public final List<String> validationErrors()
Returns the validation errors accumulated
-
getMessage
public final String getMessage()
- Overrides:
getMessagein classThrowable
-
-