Package org.onosproject.net
Class ResourceGroup
- java.lang.Object
-
- org.onlab.util.Identifier<java.lang.Long>
-
- org.onosproject.net.ResourceGroup
-
- All Implemented Interfaces:
ResourceConsumer
@Beta public final class ResourceGroup extends Identifier<java.lang.Long> implements ResourceConsumer
Intent identifier suitable as an external key.This class is immutable.
-
-
Field Summary
-
Fields inherited from class org.onlab.util.Identifier
identifier
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ResourceGroup()
Constructor for serializer.protected
ResourceGroup(long value)
Constructs the ID corresponding to a given long value.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ResourceConsumerId
consumerId()
Returns ID of this consumer.boolean
equals(java.lang.Object obj)
Compares two device key identifiers for equality.long
fingerprint()
Returns the backing value.int
hashCode()
Returns the hashcode of the identifier.static ResourceGroup
of(long value)
Creates a resource group identifier from the specified long representation.static ResourceGroup
of(java.lang.String value)
Creates a resource group identifier from the specified string representation.java.lang.String
toString()
Returns a string representation of a DeviceKeyId.-
Methods inherited from class org.onlab.util.Identifier
id
-
-
-
-
Method Detail
-
of
public static ResourceGroup of(long value)
Creates a resource group identifier from the specified long representation.- Parameters:
value
- long value- Returns:
- resource group identifier
-
of
public static ResourceGroup of(java.lang.String value)
Creates a resource group identifier from the specified string representation. Warning: it is caller responsibility to make sure the hashed value ofvalue
is unique.- Parameters:
value
- string value- Returns:
- resource group identifier
-
fingerprint
public long fingerprint()
Returns the backing value.- Returns:
- the value
-
toString
public java.lang.String toString()
Description copied from class:Identifier
Returns a string representation of a DeviceKeyId.- Overrides:
toString
in classIdentifier<java.lang.Long>
- Returns:
- string
-
consumerId
public ResourceConsumerId consumerId()
Description copied from interface:ResourceConsumer
Returns ID of this consumer.- Specified by:
consumerId
in interfaceResourceConsumer
- Returns:
- ID of this consumer
-
hashCode
public int hashCode()
Description copied from class:Identifier
Returns the hashcode of the identifier.- Overrides:
hashCode
in classIdentifier<java.lang.Long>
- Returns:
- hashcode
-
equals
public boolean equals(java.lang.Object obj)
Description copied from class:Identifier
Compares two device key identifiers for equality.- Overrides:
equals
in classIdentifier<java.lang.Long>
- Parameters:
obj
- to compare against- Returns:
- true if the objects are equal, false otherwise.
-
-