Interface DeserializerRegistry
-
- All Known Implementing Classes:
DeserializerRegistryImpl
public interface DeserializerRegistry
Registry for deserializers.- Author:
- michal.polkorab
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T extends OFGeneralDeserializer>
TgetDeserializer(MessageCodeKey key)
Gets the deserializer for the given key.void
init()
Initializes deserializers.void
registerDeserializer(MessageCodeKey key, OFGeneralDeserializer deserializer)
Registers a deserializer.boolean
unregisterDeserializer(MessageCodeKey key)
Unregisters a deserializer.
-
-
-
Method Detail
-
init
void init()
Initializes deserializers.
-
getDeserializer
<T extends OFGeneralDeserializer> T getDeserializer(MessageCodeKey key)
Gets the deserializer for the given key.- Type Parameters:
T
- type of particular deserializer- Parameters:
key
- used for deserializer lookup- Returns:
- deserializer found
-
registerDeserializer
void registerDeserializer(MessageCodeKey key, OFGeneralDeserializer deserializer)
Registers a deserializer. Throws IllegalStateException when there is a deserializer already registered under given key.If the deserializer implements
DeserializerRegistryInjector
interface, the deserializer is injected with DeserializerRegistry instance.- Parameters:
key
- used for deserializer lookupdeserializer
- deserializer instance
-
unregisterDeserializer
boolean unregisterDeserializer(MessageCodeKey key)
Unregisters a deserializer.- Parameters:
key
- used for deserializer lookup- Returns:
- true if deserializer was removed, false if no deserializer was found under specified key
-
-