Class Rule


  • @Deprecated(since="11.4",
                forRemoval=true)
    public class Rule
    extends java.lang.Object
    Deprecated, for removal: This API element is subject to removal in a future version.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static RulePriority DEFAULT_PRIORITY
      Deprecated, for removal: This API element is subject to removal in a future version.
      The default priority given to a rule if not explicitly set
      static java.lang.String STATUS_BETA
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      static java.lang.String STATUS_DEPRECATED
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      static java.lang.String STATUS_READY
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      static java.lang.String STATUS_REMOVED
      Deprecated, for removal: This API element is subject to removal in a future version.
      For internal use only.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static Rule create()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      static Rule create​(java.lang.String repositoryKey, java.lang.String key)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create with all required fields
      static Rule create​(java.lang.String repositoryKey, java.lang.String key, java.lang.String name)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create with all required fields
      RuleParam createParameter()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      RuleParam createParameter​(java.lang.String key)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      boolean equals​(java.lang.Object obj)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      org.sonar.check.Cardinality getCardinality()
      Deprecated.
      since 4.4, use isTemplate()
      java.lang.String getConfigKey()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      java.util.Date getCreatedAt()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      java.lang.String getDescription()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      java.lang.Integer getId()
      Deprecated.
      since 8.4.
      java.lang.String getKey()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      java.lang.String getLanguage()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      java.lang.String getName()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      RuleParam getParam​(java.lang.String key)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      java.util.List<RuleParam> getParams()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      Rule getParent()
      Deprecated.
      since 4.4, use getTemplate()
      java.lang.String getRepositoryKey()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      RulePriority getSeverity()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      java.lang.String getStatus()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      java.lang.String[] getSystemTags()
      Deprecated, for removal: This API element is subject to removal in a future version.
      For internal use
      java.lang.String[] getTags()
      Deprecated, for removal: This API element is subject to removal in a future version.
      For definition of rule only
      Rule getTemplate()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      java.util.Date getUpdatedAt()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      int hashCode()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      java.lang.Boolean isEnabled()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      boolean isTemplate()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      RuleKey ruleKey()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      Rule setCardinality​(org.sonar.check.Cardinality c)
      Deprecated.
      since 4.4, use setIsTemplate(boolean)
      Rule setConfigKey​(java.lang.String configKey)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the configuration key
      Rule setCreatedAt​(java.util.Date d)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      Rule setDescription​(java.lang.String description)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the rule description
      Rule setIsTemplate​(boolean isTemplate)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      Rule setKey​(java.lang.String key)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the rule key
      Rule setLanguage​(java.lang.String language)
      Deprecated, for removal: This API element is subject to removal in a future version.
      For internal use only.
      Rule setName​(java.lang.String name)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the rule name
      Rule setParams​(java.util.List<RuleParam> params)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the rule parameters
      Rule setParent​(Rule parent)
      Deprecated.
      since 4.4, use setTemplate(Rule)}
      Rule setRepositoryKey​(java.lang.String s)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      Rule setSeverity​(RulePriority severity)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      Rule setStatus​(java.lang.String status)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      Rule setSystemTags​(java.lang.String[] tags)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      Rule setTags​(java.lang.String[] tags)
      Deprecated, for removal: This API element is subject to removal in a future version.
      For definition of rule only
      Rule setTemplate​(Rule template)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      Rule setUniqueKey​(java.lang.String repositoryKey, java.lang.String key)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      Rule setUpdatedAt​(java.util.Date updatedAt)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      java.lang.String toString()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • STATUS_BETA

        public static final java.lang.String STATUS_BETA
        Deprecated, for removal: This API element is subject to removal in a future version.
        Since:
        3.6
        See Also:
        Constant Field Values
      • STATUS_DEPRECATED

        public static final java.lang.String STATUS_DEPRECATED
        Deprecated, for removal: This API element is subject to removal in a future version.
        Since:
        3.6
        See Also:
        Constant Field Values
      • STATUS_READY

        public static final java.lang.String STATUS_READY
        Deprecated, for removal: This API element is subject to removal in a future version.
        Since:
        3.6
        See Also:
        Constant Field Values
      • STATUS_REMOVED

        public static final java.lang.String STATUS_REMOVED
        Deprecated, for removal: This API element is subject to removal in a future version.
        For internal use only.
        Since:
        3.6
        See Also:
        Constant Field Values
      • DEFAULT_PRIORITY

        public static final RulePriority DEFAULT_PRIORITY
        Deprecated, for removal: This API element is subject to removal in a future version.
        The default priority given to a rule if not explicitly set
    • Method Detail

      • getId

        @Deprecated
        public java.lang.Integer getId()
        Deprecated.
        since 8.4. Use ruleKey() instead
      • getName

        public java.lang.String getName()
        Deprecated, for removal: This API element is subject to removal in a future version.
      • setName

        public Rule setName​(java.lang.String name)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Sets the rule name
      • getKey

        public java.lang.String getKey()
        Deprecated, for removal: This API element is subject to removal in a future version.
      • setKey

        public Rule setKey​(java.lang.String key)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Sets the rule key
      • getConfigKey

        public java.lang.String getConfigKey()
        Deprecated, for removal: This API element is subject to removal in a future version.
      • setConfigKey

        public Rule setConfigKey​(java.lang.String configKey)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Sets the configuration key
      • getDescription

        public java.lang.String getDescription()
        Deprecated, for removal: This API element is subject to removal in a future version.
      • setDescription

        public Rule setDescription​(java.lang.String description)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Sets the rule description
      • isEnabled

        public java.lang.Boolean isEnabled()
        Deprecated, for removal: This API element is subject to removal in a future version.
      • getParams

        public java.util.List<RuleParam> getParams()
        Deprecated, for removal: This API element is subject to removal in a future version.
      • getParam

        public RuleParam getParam​(java.lang.String key)
        Deprecated, for removal: This API element is subject to removal in a future version.
      • setParams

        public Rule setParams​(java.util.List<RuleParam> params)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Sets the rule parameters
      • createParameter

        public RuleParam createParameter()
        Deprecated, for removal: This API element is subject to removal in a future version.
      • createParameter

        public RuleParam createParameter​(java.lang.String key)
        Deprecated, for removal: This API element is subject to removal in a future version.
      • getSeverity

        public RulePriority getSeverity()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Since:
        2.5
      • setSeverity

        public Rule setSeverity​(@Nullable
                                RulePriority severity)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Parameters:
        severity - severity to set, if null, uses the default priority.
        Since:
        2.5
      • getRepositoryKey

        public java.lang.String getRepositoryKey()
        Deprecated, for removal: This API element is subject to removal in a future version.
      • setRepositoryKey

        public Rule setRepositoryKey​(java.lang.String s)
        Deprecated, for removal: This API element is subject to removal in a future version.
      • setUniqueKey

        public Rule setUniqueKey​(java.lang.String repositoryKey,
                                 java.lang.String key)
        Deprecated, for removal: This API element is subject to removal in a future version.
      • isTemplate

        public boolean isTemplate()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Since:
        4.4
      • setIsTemplate

        public Rule setIsTemplate​(boolean isTemplate)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Since:
        4.4
      • getCardinality

        @Deprecated
        public org.sonar.check.Cardinality getCardinality()
        Deprecated.
        since 4.4, use isTemplate()
      • setCardinality

        @Deprecated
        public Rule setCardinality​(org.sonar.check.Cardinality c)
        Deprecated.
        since 4.4, use setIsTemplate(boolean)
      • getParent

        @Deprecated
        public Rule getParent()
        Deprecated.
        since 4.4, use getTemplate()
      • getTemplate

        public Rule getTemplate()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Since:
        4.4
      • setTemplate

        public Rule setTemplate​(Rule template)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Since:
        4.4
      • getStatus

        public java.lang.String getStatus()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Since:
        3.6
      • setStatus

        public Rule setStatus​(java.lang.String status)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Since:
        3.6
      • getCreatedAt

        public java.util.Date getCreatedAt()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Since:
        3.6
      • setCreatedAt

        public Rule setCreatedAt​(java.util.Date d)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Since:
        3.6
      • getUpdatedAt

        public java.util.Date getUpdatedAt()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Since:
        3.6
      • setUpdatedAt

        public Rule setUpdatedAt​(java.util.Date updatedAt)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Since:
        3.6
      • getLanguage

        public java.lang.String getLanguage()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Since:
        3.6
      • setLanguage

        public Rule setLanguage​(java.lang.String language)
        Deprecated, for removal: This API element is subject to removal in a future version.
        For internal use only.
        Since:
        3.6
      • getTags

        public java.lang.String[] getTags()
        Deprecated, for removal: This API element is subject to removal in a future version.
        For definition of rule only
      • setTags

        public Rule setTags​(java.lang.String[] tags)
        Deprecated, for removal: This API element is subject to removal in a future version.
        For definition of rule only
      • getSystemTags

        public java.lang.String[] getSystemTags()
        Deprecated, for removal: This API element is subject to removal in a future version.
        For internal use
      • setSystemTags

        public Rule setSystemTags​(java.lang.String[] tags)
        Deprecated, for removal: This API element is subject to removal in a future version.
      • equals

        public boolean equals​(java.lang.Object obj)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Overrides:
        toString in class java.lang.Object
      • create

        public static Rule create()
        Deprecated, for removal: This API element is subject to removal in a future version.
      • create

        public static Rule create​(java.lang.String repositoryKey,
                                  java.lang.String key,
                                  java.lang.String name)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Create with all required fields
      • create

        public static Rule create​(java.lang.String repositoryKey,
                                  java.lang.String key)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Create with all required fields
        Since:
        2.10
      • ruleKey

        public RuleKey ruleKey()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Since:
        3.6