Enum Class PatternType

java.lang.Object
java.lang.Enum<PatternType>
org.apache.kafka.common.resource.PatternType
All Implemented Interfaces:
Serializable, Comparable<PatternType>, Constable

@Evolving public enum PatternType extends Enum<PatternType>
Resource pattern type.
  • Enum Constant Details

    • 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 Details

    • values

      public static PatternType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static PatternType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
      IllegalArgumentException - if this enum class has no constant with the specified name
      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(String name)
      Return the PatternType with the provided name or UNKNOWN if one cannot be found.