Package org.onosproject.net.intent
Class Key
- java.lang.Object
-
- org.onosproject.net.intent.Key
-
- All Implemented Interfaces:
java.lang.Comparable<Key>,ResourceConsumer
@Beta public abstract class Key extends java.lang.Object implements java.lang.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(java.lang.Object obj)longhash()inthashCode()static Keyof(long key, ApplicationId appId)Creates a key based on the provided long.static Keyof(java.lang.String key, ApplicationId appId)Creates a key based on the provided string.
-
-
-
Method Detail
-
hash
public long hash()
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public abstract boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
of
public static Key of(java.lang.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
-
-