Class ValidationErrorsWhitelist

java.lang.Object
com.atlassian.oai.validator.whitelist.ValidationErrorsWhitelist

public final class ValidationErrorsWhitelist extends Object
  • Method Details

    • create

      public static ValidationErrorsWhitelist create()
      Creates an empty validation whitelist. Start with this method when creating a new whitelist from scratch.
    • withRule

      public ValidationErrorsWhitelist withRule(String title, WhitelistRule rule)
      Creates a new whitelist with all rules of this and with a new rule.
      Parameters:
      title - A human-readable name of the new rule.
      rule - A new rule to be added.
      Returns:
      A new instance with the added rule.
    • whitelistedBy

      public Optional<NamedWhitelistRule> whitelistedBy(ValidationReport.Message message, @Nullable ApiOperation operation, @Nullable Request request, @Nullable Response response)
      Returns a whitelist rule that is applicable for the given parameters. If a non-empty value is returned then the error message should be whitelisted.
      Parameters:
      message - report message that can be whitelisted
      operation - validated api operation
      request - validated request
      response - validated response
      Returns:
      a rule that matches the arguments, or empty
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object