Enum PatternType

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

    @Evolving
    public enum PatternType
    extends java.lang.Enum<PatternType>
    Resource pattern type.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      ANY
      In a filter, matches any resource pattern type.
      LITERAL
      A literal resource name.
      MATCH
      In a filter, will perform pattern matching.
      PREFIXED
      A prefixed resource name.
      UNKNOWN
      Represents any PatternType which this client cannot understand, perhaps because this client is too old.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte code()  
      static PatternType fromCode​(byte code)
      Return the PatternType with the provided code or UNKNOWN if one cannot be found.
      static PatternType fromString​(java.lang.String name)
      Return the PatternType with the provided name or UNKNOWN if one cannot be found.
      boolean isSpecific()  
      boolean isUnknown()  
      static PatternType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static PatternType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • UNKNOWN

        public static final PatternType UNKNOWN
        Represents any PatternType which this client cannot understand, perhaps because this client is too old.
      • ANY

        public static final PatternType ANY
        In a filter, matches any resource pattern type.
      • MATCH

        public static final PatternType MATCH
        In a filter, will perform pattern matching. e.g. Given a filter of ResourcePatternFilter(TOPIC, "payments.received", MATCH)`, the filter match any ResourcePattern that matches topic 'payments.received'. This might include:
        • A Literal pattern with the same type and name, e.g. ResourcePattern(TOPIC, "payments.received", LITERAL)
        • A Wildcard pattern with the same type, e.g. ResourcePattern(TOPIC, "*", LITERAL)
        • A Prefixed pattern with the same type and where the name is a matching prefix, e.g. ResourcePattern(TOPIC, "payments.", PREFIXED)
      • LITERAL

        public static final PatternType LITERAL
        A literal resource name. A literal name defines the full name of a resource, e.g. topic with name 'foo', or group with name 'bob'. The special wildcard character * can be used to represent a resource with any name.
      • PREFIXED

        public static final PatternType PREFIXED
        A prefixed resource name. A prefixed name defines a prefix for a resource, e.g. topics with names that start with 'foo'.
    • Method Detail

      • values

        public static PatternType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (PatternType c : PatternType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static PatternType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • code

        public byte code()
        Returns:
        the code of this resource.
      • isUnknown

        public boolean isUnknown()
        Returns:
        whether this resource pattern type is UNKNOWN.
      • isSpecific

        public boolean isSpecific()
        Returns:
        whether this resource pattern type is a concrete type, rather than UNKNOWN or one of the filter types.
      • fromCode

        public static PatternType fromCode​(byte code)
        Return the PatternType with the provided code or UNKNOWN if one cannot be found.
      • fromString

        public static PatternType fromString​(java.lang.String name)
        Return the PatternType with the provided name or UNKNOWN if one cannot be found.