Package org.passay
Class RuleResultMetadata
- java.lang.Object
-
- org.passay.RuleResultMetadata
-
public class RuleResultMetadata extends Object
Describes metadata relevant to the result of rule validation.- Author:
- Middleware Services
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RuleResultMetadata.CountCategory
Count category.
-
Field Summary
Fields Modifier and Type Field Description protected Map<RuleResultMetadata.CountCategory,Integer>
counts
Character count metadata.
-
Constructor Summary
Constructors Constructor Description RuleResultMetadata()
Creates a new rule result metadata.RuleResultMetadata(RuleResultMetadata.CountCategory category, int value)
Creates a new rule result metadata.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getCount(RuleResultMetadata.CountCategory category)
Returns the count for the supplied category.Map<RuleResultMetadata.CountCategory,Integer>
getCounts()
Returns an unmodifiable map of all count metadata.boolean
hasCount(RuleResultMetadata.CountCategory category)
Returns whether a count exists for the supplied category.void
merge(RuleResultMetadata metadata)
Merges the supplied metadata with this metadata.void
putCount(RuleResultMetadata.CountCategory category, int value)
Adds a count to the metadata.String
toString()
-
-
-
Field Detail
-
counts
protected final Map<RuleResultMetadata.CountCategory,Integer> counts
Character count metadata.
-
-
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.
-
getCounts
public Map<RuleResultMetadata.CountCategory,Integer> getCounts()
Returns an unmodifiable map of all count metadata.- Returns:
- count metadata.
-
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.
-
-