Class Rule


  • public class Rule
    extends Object
    A single Checkstyle Check.
    Author:
    Paul Campbell (pcampbell@kemitix.net)
    • Constructor Detail

      • Rule

        public Rule()
    • Method Detail

      • sortByName

        protected static int sortByName​(Rule left,
                                        Rule right)
        Compare two Rules lexicographically for sorting by rule name, ignoring case.
        Parameters:
        left - the first rule
        right - the second rule
        Returns:
        the value 0 if the rules are equal; a value less than 0 if the left string is lexicographically less than the right string; and a value greater than 0 if the left string is lexicographically greater than the right string.
      • isFromSource

        public boolean isFromSource​(String sourceName)
        Checks that this rule comes from the source named.
        Parameters:
        sourceName - the name of the source to check against
        Returns:
        true if this rule comes from the source
      • getSource

        public String getSource()
        The name of the source for the rule.
        Returns:
        the source name, in lowercase.