Class ResourcePattern

java.lang.Object
org.apache.kafka.common.resource.ResourcePattern

@Evolving
public class ResourcePattern
extends Object
Represents a pattern that is used by ACLs to match zero or more Resources. The API for this class is still evolving and we may break compatibility in minor releases, if necessary.
  • Field Details

    • WILDCARD_RESOURCE

      public static final String WILDCARD_RESOURCE
      A special literal resource name that corresponds to 'all resources of a certain type'.
      See Also:
      Constant Field Values
  • Constructor Details

    • ResourcePattern

      public ResourcePattern​(ResourceType resourceType, String name, PatternType patternType)
      Create a pattern using the supplied parameters.
      Parameters:
      resourceType - non-null, specific, resource type
      name - non-null resource name, which can be the WILDCARD_RESOURCE.
      patternType - non-null, specific, resource pattern type, which controls how the pattern will match resource names.
  • Method Details

    • resourceType

      public ResourceType resourceType()
      Returns:
      the specific resource type this pattern matches
    • name

      public String name()
      Returns:
      the resource name.
    • patternType

      public PatternType patternType()
      Returns:
      the resource pattern type.
    • toFilter

      public ResourcePatternFilter toFilter()
      Returns:
      a filter which matches only this pattern.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isUnknown

      public boolean isUnknown()
      Returns:
      true if this Resource has any UNKNOWN components.
    • equals

      public boolean equals​(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object