Class ValidationResult

java.lang.Object
de.telekom.jsonfilter.operator.ValidationResult

public class ValidationResult extends Object
  • Constructor Details

    • ValidationResult

      public ValidationResult()
  • Method Details

    • withError

      public static ValidationResult withError(String error)
      Creates and returns a new instance of ValidationResult with an error message
      Parameters:
      error - the error message to be associated with the validation result
      Returns:
      ValidationResult an instance of ValidationResult with the 'valid' attribute set to false and the 'validationError' set to the provided error message
    • withError

      public static ValidationResult withError(String error, OperatorEnum operator)
      Creates and returns a new instance of ValidationResult with an error message and an operator
      Parameters:
      error - the error message to be associated with the validation result
      operator - the OperatorEnum object to be associated with the validation result
      Returns:
      ValidationResult an instance of ValidationResult with the 'valid' attribute set to false, the 'validationError' set to the provided error message and the 'operator' set to the provided operator
    • valid

      public static ValidationResult valid()
      Creates and returns a new instance of ValidationResult indicating a successful validation
      Returns:
      ValidationResult an instance of ValidationResult with the 'valid' attribute set to true