Interface Validator.Result

All Known Implementing Classes:
Failure, Success
Enclosing interface:
Validator

public static interface Validator.Result
Post-validation state. Enables access to the value object and failure case details like error messages.
  • Method Summary

    Modifier and Type
    Method
    Description
    get()
    If valid returns the value in string form.
    If validation failed, the reason is found here in plain text.
    If validation failed, the reason is found here in html.
    boolean
    Whether the validation succeeded.
  • Method Details

    • isValid

      boolean isValid()
      Whether the validation succeeded.
      Returns:
      true only if validaiton was successful.
    • getErrorMessage

      String getErrorMessage()
      If validation failed, the reason is found here in plain text.
      Returns:
      the error message if any, or null if validation succeeded.
    • getErrorMessageHtml

      String getErrorMessageHtml()
      If validation failed, the reason is found here in html.
      Returns:
      the error message if any, or null if validation succeeded.
    • get

      If valid returns the value in string form.
      Returns:
      the value.
      Throws:
      IllegalStateException - if the result is not valid.