org.sonar.api.rule
Class RuleKey

java.lang.Object
  extended by org.sonar.api.rule.RuleKey
All Implemented Interfaces:
Serializable

public class RuleKey
extends Object
implements Serializable

Key of a rule. Unique among all the rule repositories.

Since:
3.6
See Also:
Serialized Form

Field Summary
static String MANUAL_REPOSITORY_KEY
           
 
Constructor Summary
protected RuleKey(String repositoryKey, String ruleKey)
           
 
Method Summary
 boolean equals(Object o)
           
 int hashCode()
           
 boolean isManual()
           
static RuleKey of(String repository, String rule)
          Create a key.
static RuleKey parse(String s)
          Create a key from a string representation (see toString().
 String repository()
          Never null
 String rule()
          Never null
 String toString()
          Format is "repository:rule", for example "squid:AvoidCycle"
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MANUAL_REPOSITORY_KEY

public static final String MANUAL_REPOSITORY_KEY
See Also:
Constant Field Values
Constructor Detail

RuleKey

protected RuleKey(String repositoryKey,
                  String ruleKey)
Method Detail

of

public static RuleKey of(String repository,
                         String rule)
Create a key. Parameters are NOT null.


parse

public static RuleKey parse(String s)
Create a key from a string representation (see toString(). An IllegalArgumentException is raised if the format is not valid.


repository

public String repository()
Never null


rule

public String rule()
Never null


isManual

public boolean isManual()

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Format is "repository:rule", for example "squid:AvoidCycle"

Overrides:
toString in class Object


Copyright © 2009–2015 SonarSource. All rights reserved.