Interface Profile

All Superinterfaces:
LabelsItem, MetasItem
All Known Implementing Classes:
ProfileImpl

public interface Profile extends MetasItem, LabelsItem
Interface describing a Profile.

It is a set of ConfiguredRules, some of which are enabled.

Author:
Damien Carbonne
  • Method Details

    • getName

      String getName()
      Returns:
      The profile name.
    • getDescription

      String getDescription()
      Returns:
      The profile description.
    • getRules

      Set<Rule> getRules()
      Returns:
      The set of rules in this profile.
    • hasRule

      default boolean hasRule(Rule rule)
    • getEnabledRules

      default Set<Rule> getEnabledRules()
      Returns:
      The set of rules that are enabled in this profile.
    • getProfileConfig

      ProfileConfig getProfileConfig()
    • hasRule

      default boolean hasRule(RuleId ruleId)
      Parameters:
      ruleId - The rule id.
      Returns:
      true if a rule with ruleId exists in this profile.
    • getRule

      Optional<Rule> getRule(RuleId ruleId)
      Parameters:
      ruleId - The rule id.
      Returns:
      The rule with ruleId.
    • getConfiguredRule

      ConfiguredRule getConfiguredRule(Rule rule)
      Parameters:
      rule - The rule.
      Returns:
      The configured rule corresponding to rule.
    • getRuleConfig

      default RuleConfig getRuleConfig(Rule rule)
      Parameters:
      rule - The rule.
      Returns:
      The rule config.
    • isEnabled

      default boolean isEnabled(Rule rule)
      Parameters:
      rule - The rule.
      Returns:
      true if rule is enabled in this profile.
      Throws:
      IllegalArgumentException - When rule is null or is unknown.
    • getCustomizedSeverity

      default Optional<IssueSeverity> getCustomizedSeverity(Rule rule)
      Parameters:
      rule - The rule.
      Returns:
      The optional customized severity.
    • getEffectiveSeverity

      default IssueSeverity getEffectiveSeverity(Rule rule)
      Parameters:
      rule - The rule.
      Returns:
      The effective severity of rule.
      Throws:
      IllegalArgumentException - When rule is null or is unknown.
    • getParams

      default Params getParams(Rule rule)
      Returns the parameters to use for a rule.
      Parameters:
      rule - The rule.
      Returns:
      The parameters that are used to configure rule in this profile.
      Throws:
      IllegalArgumentException - When rule is null or is unknown.
    • builder

      static Profile.Builder builder()