Enum Class AbstractValidationResult.Status

java.lang.Object
java.lang.Enum<AbstractValidationResult.Status>
ch.tocco.nice2.validate.api.result.AbstractValidationResult.Status
All Implemented Interfaces:
Serializable, Comparable<AbstractValidationResult.Status>, Constable
Enclosing class:
AbstractValidationResult

public static enum AbstractValidationResult.Status extends Enum<AbstractValidationResult.Status>

 UNCHECKED           => either not checked yet, or check skipped because others failed already.
 PRECONDITION_FAILED => for example a check that involves multiple fields is not executed because
                        some information is missing; a definite check and result cannot be given
                        at this time. this state could be used in the gui to not set the color of
                        a field to green yet.
 DISABLED            => for example after a warning which was suppressed, or a condition that
                        disables it, or not checked because the value was empty. it can also mean
                        "ignored". That might be the better name anyway.
 OK                  => check done and succeeded
 INFO                => check done and theoretically failed but only fires an "info text". such
                        a test cannot "fail".
 WARN                => check done and succeeded, but a warning was issued. this may be ignored,
                        logged, or shown to the user "are you sure?".
 ERROR               => check done and failed
 
  • Enum Constant Details

  • Method Details

    • values

      public static AbstractValidationResult.Status[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static AbstractValidationResult.Status valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isOk

      public boolean isOk()
      Tells if the data is accepted, either because the validation passed or did not need to be run.
    • validationFailed

      public boolean validationFailed()
      Tells if the validation (as defined) failed, but not if it's ok. The test (as defined) may have failed and still we consider it ok. (This is the case with the INFO level.)
    • wasRun

      public boolean wasRun()
      Tells if the validation was executed.
    • hasMessage

      public boolean hasMessage()
      Tells if there should be a message (based on status code) for the user/log. If there is one it does not indicate at all if the valdation passed or not.
    • betterThan

      public boolean betterThan(AbstractValidationResult.Status other)
      Tells if this Status is "better" (less bad) than other.