Package org.passay

Class RuleResultMetadata


  • public class RuleResultMetadata
    extends Object
    Describes metadata relevant to the result of rule validation.
    Author:
    Middleware Services
    • Constructor Detail

      • RuleResultMetadata

        public RuleResultMetadata()
        Creates a new rule result metadata.
      • RuleResultMetadata

        public RuleResultMetadata​(RuleResultMetadata.CountCategory category,
                                  int value)
        Creates a new rule result metadata.
        Parameters:
        category - count category.
        value - count value.
    • Method Detail

      • hasCount

        public boolean hasCount​(RuleResultMetadata.CountCategory category)
        Returns whether a count exists for the supplied category.
        Parameters:
        category - of the count.
        Returns:
        whether a count exists.
      • getCount

        public int getCount​(RuleResultMetadata.CountCategory category)
        Returns the count for the supplied category.
        Parameters:
        category - of the count.
        Returns:
        character count.
      • putCount

        public void putCount​(RuleResultMetadata.CountCategory category,
                             int value)
        Adds a count to the metadata.
        Parameters:
        category - of the count.
        value - non-negative character count.
      • merge

        public void merge​(RuleResultMetadata metadata)
        Merges the supplied metadata with this metadata. This method will overwrite any existing categories.
        Parameters:
        metadata - to merge.