Package org.apache.kafka.common.resource
Class ResourceFilter
- java.lang.Object
-
- org.apache.kafka.common.resource.ResourceFilter
-
@Evolving public class ResourceFilter extends java.lang.Object
A filter which matches Resource objects. The API for this class is still evolving and we may break compatibility in minor releases, if necessary.
-
-
Field Summary
Fields Modifier and Type Field Description static ResourceFilterANYMatches any resource.
-
Constructor Summary
Constructors Constructor Description ResourceFilter(ResourceType resourceType, java.lang.String name)Create an instance of this class with the provided parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)java.lang.StringfindIndefiniteField()Return a string describing an ANY or UNKNOWN field, or null if there is no such field.inthashCode()booleanisUnknown()Return true if this ResourceFilter has any UNKNOWN components.booleanmatches(Resource other)Return true if this filter matches the given Resource.booleanmatchesAtMostOne()Return true if this filter could only match one ACE.java.lang.Stringname()Return the resource name or null.ResourceTyperesourceType()Return the resource type.java.lang.StringtoString()
-
-
-
Field Detail
-
ANY
public static final ResourceFilter ANY
Matches any resource.
-
-
Constructor Detail
-
ResourceFilter
public ResourceFilter(ResourceType resourceType, java.lang.String name)
Create an instance of this class with the provided parameters.- Parameters:
resourceType- non-null resource typename- resource name or null
-
-
Method Detail
-
resourceType
public ResourceType resourceType()
Return the resource type.
-
name
public java.lang.String name()
Return the resource name or null.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
isUnknown
public boolean isUnknown()
Return true if this ResourceFilter has any UNKNOWN components.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
matches
public boolean matches(Resource other)
Return true if this filter matches the given Resource.
-
matchesAtMostOne
public boolean matchesAtMostOne()
Return true if this filter could only match one ACE. In other words, if there are no ANY or UNKNOWN fields.
-
findIndefiniteField
public java.lang.String findIndefiniteField()
Return a string describing an ANY or UNKNOWN field, or null if there is no such field.
-
-