Class ResourcePatternFilter
java.lang.Object
org.apache.kafka.common.resource.ResourcePatternFilter
Represents a filter that can match
ResourcePattern.Field Summary
FieldsConstructor Summary
ConstructorsConstructorDescriptionResourcePatternFilter(ResourceType resourceType, String name, PatternType patternType) Create a filter using the supplied parameters.Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()booleanbooleanmatches(ResourcePattern pattern) booleanname()toString()
Field Details
ANY
Matches any resource pattern.
Constructor Details
ResourcePatternFilter
Create a filter using the supplied parameters.- Parameters:
resourceType- non-null resource type. IfResourceType.ANY, the filter will ignore the resource type of the pattern. If any other resource type, the filter will match only patterns with the same type.name- resource name ornull. Ifnull, the filter will ignore the name of resources. IfResourcePattern.WILDCARD_RESOURCE, will match only wildcard patterns.patternType- non-null resource pattern type. IfPatternType.ANY, the filter will match patterns regardless of pattern type. IfPatternType.MATCH, the filter will match patterns that would match the suppliedname, including a matching prefixed and wildcards patterns. If any other resource pattern type, the filter will match only patterns with the same type.
Method Details
isUnknown
public boolean isUnknown()- Returns:
trueif this filter has any UNKNOWN components.
resourceType
- Returns:
- the specific resource type this pattern matches
name
- Returns:
- the resource name.
patternType
- Returns:
- the resource pattern type.
matches
- Returns:
trueif this filter matches the given pattern.
matchesAtMostOne
public boolean matchesAtMostOne()- Returns:
trueif this filter could only match one pattern. In other words, if there are no ANY or UNKNOWN fields.
findIndefiniteField
- Returns:
- a string describing any ANY or UNKNOWN field, or null if there is no such field.
toString
equals
hashCode