Package org.apache.kafka.common.resource
Class Resource
- java.lang.Object
-
- org.apache.kafka.common.resource.Resource
-
@Evolving public class Resource extends java.lang.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 ResourceCLUSTERA resource representing the whole cluster.static java.lang.StringCLUSTER_NAMEThe name of the CLUSTER resource.
-
Constructor Summary
Constructors Constructor Description Resource(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)inthashCode()booleanisUnknown()Return true if this Resource has any UNKNOWN components.java.lang.Stringname()Return the resource name.ResourceTyperesourceType()Return the resource type.ResourceFiltertoFilter()Create a filter which matches only this Resource.java.lang.StringtoString()
-
-
-
Field Detail
-
CLUSTER_NAME
public static final java.lang.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 Detail
-
Resource
public Resource(ResourceType resourceType, java.lang.String name)
Create an instance of this class with the provided parameters.- Parameters:
resourceType- non-null resource typename- non-null resource name
-
-
Method Detail
-
resourceType
public ResourceType resourceType()
Return the resource type.
-
name
public java.lang.String name()
Return the resource name.
-
toFilter
public ResourceFilter toFilter()
Create a filter which matches only this Resource.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
isUnknown
public boolean isUnknown()
Return true if this Resource 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
-
-