Package cdc.issues.rules
Class CompositeRulesCatalog
- java.lang.Object
-
- cdc.issues.rules.CompositeRulesCatalog
-
- All Implemented Interfaces:
RulesCatalog
public class CompositeRulesCatalog extends Object implements RulesCatalog
Implementation ofRulesCatalogthat aggregates delegates catalogs.This implementation does not cache any data.
- Author:
- Damien Carbonne
-
-
Constructor Summary
Constructors Constructor Description CompositeRulesCatalog()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompositeRulesCatalogadd(RulesCatalog catalog)Adds a new delegate catalog.Set<String>getDomains()Set<IssuesDetector.Factory<?>>getFactories()<T> Set<IssuesDetector.Factory<T>>getFactories(Class<T> dataClass)Returns a set of allIssuesDetector.Factorys registered for a data class.<T> Optional<IssuesDetector.Factory<T>>getFactory(Rule rule, Class<T> dataClass)Returns theIssuesDetector.Factoryassociated to a Rule and a Class, ornull.Optional<Rule>getRule(RuleId id)Returns the rule that has a given id.Set<Rule>getRules()-
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, getRules, hasDescriptor, hasDomain, hasRule, hasRule
-
-
-
-
Method Detail
-
add
public CompositeRulesCatalog add(RulesCatalog catalog)
Adds a new delegate catalog.- Parameters:
catalog- The catalog to add.- Returns:
- This catalog.
-
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.
-
getRule
public Optional<Rule> getRule(RuleId id)
Description copied from interface:RulesCatalogReturns the rule that has a given id.- Specified by:
getRulein interfaceRulesCatalog- Parameters:
id- The id.- Returns:
- The rule identified by
id.
-
getFactories
public Set<IssuesDetector.Factory<?>> getFactories()
- Specified by:
getFactoriesin interfaceRulesCatalog- Returns:
- A set of all known
IssuesDetector.Factorys.
-
getFactories
public <T> Set<IssuesDetector.Factory<T>> getFactories(Class<T> dataClass)
Description copied from interface:RulesCatalogReturns a set of allIssuesDetector.Factorys registered for a data class.- Specified by:
getFactoriesin interfaceRulesCatalog- Type Parameters:
T- The data type.- Parameters:
dataClass- The data class.- Returns:
- A set of all
IssuesDetector.Factorys registered fordataClass.
-
getFactory
public <T> Optional<IssuesDetector.Factory<T>> getFactory(Rule rule, Class<T> dataClass)
Description copied from interface:RulesCatalogReturns theIssuesDetector.Factoryassociated to a Rule and a Class, ornull.- Specified by:
getFactoryin interfaceRulesCatalog- Type Parameters:
T- The data type.- Parameters:
rule- The rule.dataClass- The data class.- Returns:
- The
IssuesDetector.Factoryassociated toruleanddataClass, ornull.
-
-