Package org.passay

Class RuleResult


  • public class RuleResult
    extends Object
    Result of a password rule validation.
    Author:
    Middleware Services
    • Field Detail

      • valid

        protected boolean valid
        Whether password rule was successful.
    • Constructor Detail

      • RuleResult

        public RuleResult()
        Creates a new rule result with its validity set to true.
      • RuleResult

        public RuleResult​(boolean b)
        Creates a new rule result.
        Parameters:
        b - result validity
      • RuleResult

        public RuleResult​(boolean b,
                          RuleResultDetail rrd)
        Creates a new rule result.
        Parameters:
        b - result validity
        rrd - details associated with this result
      • RuleResult

        public RuleResult​(boolean b,
                          RuleResultMetadata rrm)
        Creates a new rule result.
        Parameters:
        b - result validity
        rrm - metadata associated by the rule with the password
      • RuleResult

        public RuleResult​(boolean b,
                          RuleResultDetail rrd,
                          RuleResultMetadata rrm)
        Creates a new rule result.
        Parameters:
        b - result validity
        rrd - details associated with this result
        rrm - metadata associated by the rule with the password
    • Method Detail

      • isValid

        public boolean isValid()
        Returns whether the result of the rule verification is a valid password.
        Returns:
        valid password for this rule
      • setValid

        public void setValid​(boolean b)
        Sets whether the result of the rule verification is a valid password.
        Parameters:
        b - valid password for this rule
      • getDetails

        public List<RuleResultDetail> getDetails()
        Returns any details associated with the rule verification.
        Returns:
        rule result details
      • addError

        public void addError​(String code,
                             Map<String,​Object> params)
        Adds a new rule result detail with the given error details and sets the result of the rule verification to invalid.
        Parameters:
        code - error code
        params - error details
      • setDetails

        public void setDetails​(RuleResultDetail... rrd)
        Sets any details associated with the rule verification.
        Parameters:
        rrd - rule result details
      • setDetails

        public void setDetails​(List<RuleResultDetail> rrd)
        Sets any details associated with the rule verification.
        Parameters:
        rrd - rule result details
      • getMetadata

        public RuleResultMetadata getMetadata()
        Returns metadata associated with the rule verification.
        Returns:
        rule result metadata
      • setMetadata

        public void setMetadata​(RuleResultMetadata rrm)
        Sets metadata associated with the rule verification.
        Parameters:
        rrm - rule result metadata