Package org.onosproject.net.flow
Interface Extension
-
- All Known Subinterfaces:
ExtensionSelector
,ExtensionTreatment
- All Known Implementing Classes:
AbstractExtension
,UnresolvedExtensionSelector
,UnresolvedExtensionTreatment
public interface Extension
An extension to the northbound APIs.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
deserialize(byte[] data)
Deserialize the extension from a byte array.java.util.List<java.lang.String>
getProperties()
Gets a list of all properties on the extension.<T> T
getPropertyValue(java.lang.String key)
Gets a property value of an extension.byte[]
serialize()
Serialize the extension to a byte array.<T> void
setPropertyValue(java.lang.String key, T value)
Sets a property on the extension.
-
-
-
Method Detail
-
setPropertyValue
<T> void setPropertyValue(java.lang.String key, T value) throws ExtensionPropertyException
Sets a property on the extension.- Type Parameters:
T
- class of the value- Parameters:
key
- property keyvalue
- value to set for the given key- Throws:
ExtensionPropertyException
- if the given key is not a valid property on this extension
-
getPropertyValue
<T> T getPropertyValue(java.lang.String key) throws ExtensionPropertyException
Gets a property value of an extension.- Type Parameters:
T
- class of the value- Parameters:
key
- property key- Returns:
- value of the property
- Throws:
ExtensionPropertyException
- if the given key is not a valid property on this extension
-
getProperties
java.util.List<java.lang.String> getProperties()
Gets a list of all properties on the extension.- Returns:
- list of properties
-
serialize
byte[] serialize()
Serialize the extension to a byte array.- Returns:
- byte array
-
deserialize
void deserialize(byte[] data)
Deserialize the extension from a byte array. The properties of this object will be overwritten with the data in the byte array.- Parameters:
data
- input byte array
-
-