Interface ValidatorResponse


public interface ValidatorResponse
  • Method Details

    • create

      static ValidatorResponse create()
      Create a new valid response.
      Returns:
      a new valid response
    • create

      static ValidatorResponse create(Annotation annotation, String message, Object invalidValue)
      Create a new failed response.
      Parameters:
      annotation - annotation that triggered the check
      message - message describing the failure
      invalidValue - the value that triggered the failure
      Returns:
      a new failed response
    • valid

      boolean valid()
      Whether the response was valid.
      Returns:
      if valid
    • annotation

      Annotation annotation()
      Annotation that triggered the check.
      Returns:
      annotation of the check
      Throws:
      IllegalStateException - in case the response is valid
    • message

      String message()
      Error message describing the failure.
      Returns:
      error message
      Throws:
      IllegalStateException - in case the response is valid
    • invalidValue

      Object invalidValue()
      The value that triggered the failure.
      Returns:
      the value
      Throws:
      IllegalStateException - in case the response is valid