Class Resource

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

@Evolving
public class Resource
extends Object
Represents a cluster resource with a tuple of (type, name). The API for this class is still evolving and we may break compatibility in minor releases, if necessary.
  • Field Details

    • CLUSTER_NAME

      public static final String CLUSTER_NAME
      The name of the CLUSTER resource.
      See Also:
      Constant Field Values
    • CLUSTER

      public static final Resource CLUSTER
      A resource representing the whole cluster.
  • Constructor Details

    • Resource

      public Resource​(ResourceType resourceType, String name)
      Create an instance of this class with the provided parameters.
      Parameters:
      resourceType - non-null resource type
      name - non-null resource name
  • Method Details

    • resourceType

      public ResourceType resourceType()
      Return the resource type.
    • name

      public String name()
      Return the resource name.
    • toString

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

      public boolean isUnknown()
      Return 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