Class RuleKey

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<RuleKey>

    @Immutable
    public class RuleKey
    extends java.lang.Object
    implements java.io.Serializable, java.lang.Comparable<RuleKey>
    Key of a rule. Unique among all the rule repositories.
    Since:
    3.6
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected RuleKey​(java.lang.String repositoryKey, java.lang.String ruleKey)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(RuleKey o)  
      boolean equals​(java.lang.Object o)  
      int hashCode()  
      static RuleKey of​(java.lang.String repository, java.lang.String rule)
      Create a key.
      static RuleKey parse​(java.lang.String s)
      Create a key from a string representation (see toString().
      java.lang.String repository()
      Never null
      java.lang.String rule()
      Never null
      java.lang.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

      • EXTERNAL_RULE_REPO_PREFIX

        public static final java.lang.String EXTERNAL_RULE_REPO_PREFIX
        See Also:
        Constant Field Values
    • Constructor Detail

      • RuleKey

        protected RuleKey​(java.lang.String repositoryKey,
                          java.lang.String ruleKey)
    • Method Detail

      • of

        public static RuleKey of​(java.lang.String repository,
                                 java.lang.String rule)
        Create a key. Parameters are NOT null.
      • parse

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

        public java.lang.String repository()
        Never null
      • rule

        public java.lang.String rule()
        Never null
      • equals

        public boolean equals​(@Nullable
                              java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Format is "repository:rule", for example "squid:AvoidCycle"
        Overrides:
        toString in class java.lang.Object
      • compareTo

        public int compareTo​(RuleKey o)
        Specified by:
        compareTo in interface java.lang.Comparable<RuleKey>