Package org.apache.kafka.common.resource
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 Summary
Fields Modifier and Type Field Description static Resource
CLUSTER
A resource representing the whole cluster.static String
CLUSTER_NAME
The name of the CLUSTER resource. -
Constructor Summary
Constructors Constructor Description Resource(ResourceType resourceType, String name)
Create an instance of this class with the provided parameters. -
Method Summary
Modifier and Type Method Description boolean
equals(Object o)
int
hashCode()
boolean
isUnknown()
Return true if this Resource has any UNKNOWN components.String
name()
Return the resource name.ResourceType
resourceType()
Return the resource type.String
toString()
-
Field Details
-
CLUSTER_NAME
The name of the CLUSTER resource.- See Also:
- Constant Field Values
-
CLUSTER
A resource representing the whole cluster.
-
-
Constructor Details
-
Resource
Create an instance of this class with the provided parameters.- Parameters:
resourceType
- non-null resource typename
- non-null resource name
-
-
Method Details
-
resourceType
Return the resource type. -
name
Return the resource name. -
toString
-
isUnknown
public boolean isUnknown()Return true if this Resource has any UNKNOWN components. -
equals
-
hashCode
public int hashCode()
-