Interface SerializerRegistry
- All Known Implementing Classes:
SerializerRegistryImpl
public interface SerializerRegistry
- Author:
- michal.polkorab
-
Method Summary
Modifier and TypeMethodDescription<K,
S extends OFGeneralSerializer>
SgetSerializer
(MessageTypeKey<K> msgTypeKey) Gets the serializer for the given type.void
init()
Serializer registry provisioning.boolean
Checks if group add mod messages are enabled.<K> void
registerSerializer
(MessageTypeKey<K> key, OFGeneralSerializer serializer) Registers a serializer.void
setGroupAddModConfig
(boolean isGroupAddModEnabled) Sets whether or not group add mod messages are enabled.<K> boolean
unregisterSerializer
(MessageTypeKey<K> key) Unregisters a serializer.
-
Method Details
-
init
void init()Serializer registry provisioning. -
getSerializer
Gets the serializer for the given type.- Type Parameters:
K
- input key typeS
- type of resulting serializer- Parameters:
msgTypeKey
- lookup key- Returns:
- serializer or NullPointerException if no serializer was found
-
registerSerializer
Registers a serializer.If the serializer implements
SerializerRegistryInjector
interface, the serializer is injected with SerializerRegistry instance.- Type Parameters:
K
- serializer key type- Parameters:
key
- used for serializer lookupserializer
- serializer implementation- Throws:
IllegalStateException
- when there is a serializer already registered under given key
-
unregisterSerializer
Unregisters a serializer.- Type Parameters:
K
- serializer key type- Parameters:
key
- used for serializer lookup- Returns:
- true if serializer was removed, false if no serializer was found under specified key
-
isGroupAddModEnabled
boolean isGroupAddModEnabled()Checks if group add mod messages are enabled.- Returns:
- true if group add mod messages are enabled
-
setGroupAddModConfig
void setGroupAddModConfig(boolean isGroupAddModEnabled) Sets whether or not group add mod messages are enabled.- Parameters:
isGroupAddModEnabled
- true if group add mod messages are enabled
-