Class Validations.ValidationResult<T>

  • Type Parameters:
    T - the type of resource retrieved during validation.
    Enclosing class:
    Validations

    public static class Validations.ValidationResult<T>
    extends Object
    The result of a validation, which is either the retrieved resource or a message explaining the validation error.
    • Method Detail

      • isValid

        public boolean isValid()
        Determines if validation was successful,in which case getResult() returns the retrieved resource and getErrorMessage() is null.
        Returns:
        true if validation is successful, false otherwise.
      • getErrorMessage

        public String getErrorMessage()
        Returns the message explaining the validation error.
        Returns:
        the message explaining the validation error, null if validation is successful.
      • getResult

        public T getResult()
        Returns the retrieved resources as a result of the validation.
        Returns:
        the retrieved resource, null if validation is not a success.