Package org.passay

Class RuleResultDetail

java.lang.Object
org.passay.RuleResultDetail

public final class RuleResultDetail extends Object
Describes an exact cause of a rule validation failure.
  • Field Details

    • errorCodes

      private final String[] errorCodes
      Detail error codes.
    • parameters

      private final Map<String,Object> parameters
      Additional parameters that provide information about validation failure.
  • Constructor Details

    • RuleResultDetail

      public RuleResultDetail(String code, Map<String,Object> params)
      Creates a new rule result detail.
      Parameters:
      code - error code.
      params - error details.
    • RuleResultDetail

      public RuleResultDetail(String[] codes, Map<String,Object> params)
      Creates a new rule result detail.
      Parameters:
      codes - One or more error codes. Codes MUST be provided in order of decreasing specificity.
      params - error details.
  • Method Details

    • getErrorCode

      public String getErrorCode()
      Returns the least-specific error code.
      Returns:
      error code.
    • getErrorCodes

      public String[] getErrorCodes()
      Returns an array of error codes as provided at creation time.
      Returns:
      Array of error codes that the caller may assume are organized in order of decreasing specificity.
    • getParameters

      public Map<String,Object> getParameters()
      Returns the parameters.
      Returns:
      map of parameter name to value.
    • getValues

      public Object[] getValues()
      Returns the parameter values.
      Returns:
      array of parameters or empty array if no parameters defined.
    • toString

      public String toString()
      Overrides:
      toString in class Object