Package org.onosproject.net.resource
Class ResourceConsumerId
- java.lang.Object
-
- org.onosproject.net.resource.ResourceConsumerId
-
public class ResourceConsumerId extends java.lang.Object
Representation of global unique ID for ResourceConsumer object.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ResourceConsumerId()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
consumerClass()
Returns class name of the consumer.boolean
equals(java.lang.Object o)
int
hashCode()
boolean
isClassOf(java.lang.Class<?> cls)
Checks if the consumer is an instance of given class.static <T extends ResourceConsumer>
ResourceConsumerIdof(long value, java.lang.Class<T> cls)
Creates ResourceConsumerId from given value and class.static <T extends Identifier<java.lang.Long> & ResourceConsumer>
ResourceConsumerIdof(T id)
Creates ResourceConsumerId instance from Identifier object.long
value()
Returns ID value.
-
-
-
Method Detail
-
isClassOf
public boolean isClassOf(java.lang.Class<?> cls)
Checks if the consumer is an instance of given class.- Parameters:
cls
- class object- Returns:
- result of check
-
consumerClass
public java.lang.String consumerClass()
Returns class name of the consumer.- Returns:
- class name of the consumer in String
-
value
public long value()
Returns ID value.- Returns:
- ID value
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
of
public static <T extends ResourceConsumer> ResourceConsumerId of(long value, java.lang.Class<T> cls)
Creates ResourceConsumerId from given value and class.- Type Parameters:
T
- resource consumer class type- Parameters:
value
- ID value unique within the given classcls
- class of ResourceConsumer implementation- Returns:
- created ResourceConsumerId object
-
of
public static <T extends Identifier<java.lang.Long> & ResourceConsumer> ResourceConsumerId of(T id)
Creates ResourceConsumerId instance from Identifier object.- Type Parameters:
T
- resource consumer class type- Parameters:
id
- identifier object backed by Long value- Returns:
- created ResourceConsumerId object
-
-