Package cdc.issues.rules
Class DefaultRulesCatalog
- java.lang.Object
-
- cdc.issues.rules.DefaultRulesCatalog
-
- All Implemented Interfaces:
RulesCatalog
public class DefaultRulesCatalog extends Object implements RulesCatalog
Default implementation ofRulesCatalog.- Author:
- Damien Carbonne
-
-
Constructor Summary
Constructors Constructor Description DefaultRulesCatalog()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> IssuesDetector.Descriptor<T>getDescriptorOrNull(Rule rule, Class<T> dataClass)Returns theIssuesDetector.Descriptorassociated to a Rule and a Class, ornull.Set<IssuesDetector.Descriptor<?>>getDescriptors()<T> Set<IssuesDetector.Descriptor<T>>getDescriptors(Class<T> dataClass)Returns a set of all Descriptors registered for a data class.Set<String>getDomains()Set<Rule>getRules()Set<Rule>getRules(String domain)Returns a set of all known rules belonging to a domain.<T> DefaultRulesCatalogregister(IssuesDetector.Descriptor<T> descriptor)DefaultRulesCatalogregister(Rule rule)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface cdc.issues.rules.RulesCatalog
apply, apply, apply, createIssuesDetector, getDescriptor, hasDescriptor, hasDomain, hasRule
-
-
-
-
Method Detail
-
register
public DefaultRulesCatalog register(Rule rule)
-
register
public <T> DefaultRulesCatalog register(IssuesDetector.Descriptor<T> descriptor)
-
getDomains
public Set<String> getDomains()
- Specified by:
getDomainsin interfaceRulesCatalog- Returns:
- A set of all known domains.
-
getRules
public Set<Rule> getRules()
- Specified by:
getRulesin interfaceRulesCatalog- Returns:
- A set of all known
Rules.
-
getRules
public Set<Rule> getRules(String domain)
Description copied from interface:RulesCatalogReturns a set of all known rules belonging to a domain.- Specified by:
getRulesin interfaceRulesCatalog- Parameters:
domain- The domain.- Returns:
- A set of rules belonging to
domain.
-
getDescriptors
public Set<IssuesDetector.Descriptor<?>> getDescriptors()
- Specified by:
getDescriptorsin interfaceRulesCatalog- Returns:
- A set of all known
IssuesDetector.Descriptors.
-
getDescriptors
public <T> Set<IssuesDetector.Descriptor<T>> getDescriptors(Class<T> dataClass)
Description copied from interface:RulesCatalogReturns a set of all Descriptors registered for a data class.- Specified by:
getDescriptorsin interfaceRulesCatalog- Type Parameters:
T- The data type.- Parameters:
dataClass- The data class.- Returns:
- A set of all Descriptors registered for
dataClass.
-
getDescriptorOrNull
public <T> IssuesDetector.Descriptor<T> getDescriptorOrNull(Rule rule, Class<T> dataClass)
Description copied from interface:RulesCatalogReturns theIssuesDetector.Descriptorassociated to a Rule and a Class, ornull.- Specified by:
getDescriptorOrNullin interfaceRulesCatalog- Type Parameters:
T- The data type.- Parameters:
rule- The rule.dataClass- The data class.- Returns:
- The
IssuesDetector.Descriptorassociated toruleanddataClass, ornull.
-
-