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 org.onlab.util.Identifier<java.lang.Long> implements ResourceConsumer
Intent identifier suitable as an external key.This class is immutable.
-
-
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)
long
fingerprint()
Returns the backing value.int
hashCode()
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()
-
-
-
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()
- Overrides:
toString
in classorg.onlab.util.Identifier<java.lang.Long>
-
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()
- Overrides:
hashCode
in classorg.onlab.util.Identifier<java.lang.Long>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classorg.onlab.util.Identifier<java.lang.Long>
-
-