Class EndpointValidationException

All Implemented Interfaces:
Serializable

public class EndpointValidationException extends EndpointException
A validation exception class that is intended to be thrown when any endpoint method receives invalid parameter(s). Behaves similar to the EndpointException and contains additional information about the validation errors.
See Also:
  • Constructor Details

    • EndpointValidationException

      public EndpointValidationException(EndpointValidationException.ValidationErrorData data)
      Creates a validation exception from the error data.
      Parameters:
      data - validation error data, mandatory (cannot be null)
    • EndpointValidationException

      public EndpointValidationException(List<EndpointValidationException.ValidationErrorData> validationErrorData)
      Creates a validation exception from a error data list.
      Parameters:
      validationErrorData - A list of validation error data, must not be null or empty.
    • EndpointValidationException

      public EndpointValidationException(String message, List<EndpointValidationException.ValidationErrorData> validationErrorData)
      Creates a validation exception from a error data list.
      Parameters:
      message - General error message.
      validationErrorData - A list of validation error data, must not be null or empty.
  • Method Details

    • getValidationErrorData

      public List<EndpointValidationException.ValidationErrorData> getValidationErrorData()
      Gets the collection of the data on the validation errors.
      Returns:
      the error data
    • getSerializationData

      public Map<String,Object> getSerializationData()
      Description copied from class: EndpointException
      Creates a map with the serialization data to be sent to the client when the exception thrown is processed by EndpointController. The following data will be sent to the client:
      • exception type: either the original exception type or EndpointException, if no original exception is given
      • message: non-blank message either from the constructor or from the original exception. If both are blank, none provided.
      • detail: detail object serialized to json, if provided in the corresponding constructor
      Overrides:
      getSerializationData in class EndpointException
      Returns:
      the data to be sent to the client