Package org.onosproject.net.intent
Class Key
- java.lang.Object
-
- org.onosproject.net.intent.Key
-
- All Implemented Interfaces:
Comparable<Key>,ResourceConsumer
@Beta public abstract class Key extends Object implements Comparable<Key>, ResourceConsumer
Key class for Intents.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedKey(long hash)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ResourceConsumerIdconsumerId()Returns ID of this consumer.abstract booleanequals(Object obj)longhash()inthashCode()static Keyof(long key, ApplicationId appId)Creates a key based on the provided long.static Keyof(String key, ApplicationId appId)Creates a key based on the provided string.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Comparable
compareTo
-
-
-
-
Method Detail
-
hash
public long hash()
-
of
public static Key of(String key, ApplicationId appId)
Creates a key based on the provided string.Note: Two keys with equal value, but different appId, are not equal. Warning: it is caller responsibility to make sure the hashed value of
valueis unique.- Parameters:
key- the provided stringappId- application id to associate with this key- Returns:
- the key for the string
-
of
public static Key of(long key, ApplicationId appId)
Creates a key based on the provided long.Note: Two keys with equal value, but different appId, are not equal. Also, "10" and 10L are different.
- Parameters:
key- the provided longappId- application id to associate with this key- Returns:
- the key for the long
-
consumerId
public ResourceConsumerId consumerId()
Description copied from interface:ResourceConsumerReturns ID of this consumer.- Specified by:
consumerIdin interfaceResourceConsumer- Returns:
- ID of this consumer
-
-