*/
public static final String STATUS_REMOVED = "REMOVED";
+ /**
+ * List of available status
+ * @since 3.6
+ */
+ private static final Set<String> STATUS_LIST = ImmutableSet.of(STATUS_READY, STATUS_BETA, STATUS_DEPRECATED, STATUS_REMOVED);
+
@Id
@Column(name = "id")
@Column(name = "plugin_config_key", updatable = true, nullable = true, length = 500)
private String configKey;
- // Godin: This field should be named priority, otherwise StandardRulesXmlParserTest fails
@Column(name = "priority", updatable = true, nullable = true)
@Enumerated(EnumType.ORDINAL)
private RulePriority priority = DEFAULT_PRIORITY;
*/
@Deprecated
public Rule() {
- // TODO reduce visibility to package
+ // TODO reduce visibility to packaete
}
/**
* @since 3.6
*/
public Rule setStatus(String status) {
- if (!getStatusList().contains(status)) {
- throw new SonarException("The status of a rule can only contain : " + Joiner.on(", ").join(getStatusList()));
+ if (!STATUS_LIST.contains(status)) {
+ throw new SonarException("The status of a rule can only contain : " + Joiner.on(", ").join(STATUS_LIST));
}
this.status = status;
return this;
return new Rule().setUniqueKey(repositoryKey, key);
}
- /**
- * @since 3.6
- */
- public static Set<String> getStatusList() {
- return ImmutableSet.of(STATUS_READY, STATUS_BETA, STATUS_DEPRECATED, STATUS_REMOVED);
- }
-
/**
* @since 3.6
*/