Package org.apache.kafka.common.resource
Enum Class PatternType
- All Implemented Interfaces:
Serializable
,Comparable<PatternType>
,Constable
Resource pattern type.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionIn a filter, matches any resource pattern type.A literal resource name.In a filter, will perform pattern matching.A prefixed resource name.Represents any PatternType which this client cannot understand, perhaps because this client is too old. -
Method Summary
Modifier and TypeMethodDescriptionbyte
code()
static PatternType
fromCode
(byte code) Return the PatternType with the provided code orUNKNOWN
if one cannot be found.static PatternType
fromString
(String name) Return the PatternType with the provided name orUNKNOWN
if one cannot be found.boolean
boolean
static PatternType
Returns the enum constant of this class with the specified name.static PatternType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
UNKNOWN
Represents any PatternType which this client cannot understand, perhaps because this client is too old. -
ANY
In a filter, matches any resource pattern type. -
MATCH
In a filter, will perform pattern matching. e.g. Given a filter ofResourcePatternFilter(TOPIC, "payments.received", MATCH)`
, the filter match anyResourcePattern
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)
- A Literal pattern with the same type and name, e.g.
-
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
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
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
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 nameNullPointerException
- 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
Return the PatternType with the provided code orUNKNOWN
if one cannot be found. -
fromString
Return the PatternType with the provided name orUNKNOWN
if one cannot be found.
-