001/*-------------------------------------------------------------------------+
002|                                                                          |
003| Copyright (c) 2009-2019 CQSE GmbH                                        |
004|                                                                          |
005+-------------------------------------------------------------------------*/
006package eu.cqse.check.framework.core.ruleset;
007
008import java.util.function.BiConsumer;
009
010/**
011 * Functions to be provided by rules in a rule set.
012 */
013public interface IRulesetRule {
014
015        /**
016         * Returns a human readable rule id (e.g. "M2-1-3") that is unique within the
017         * ruleset.
018         */
019        String getRuleId();
020
021        /** Returns a readable name of description of the rule. */
022        String getRuleText();
023
024        /**
025         * Allows to contribute rule mappings that are not custom checks. See
026         * implementations for examples.
027         * 
028         * @param contributor
029         *            accepts the rule id and the name of the general check.
030         */
031        void contributeRules(BiConsumer<String, String> contributor);
032}