Interface DeserializerRegistry
- All Known Implementing Classes:
DeserializerRegistryImpl
public interface DeserializerRegistry
Registry for deserializers.
- Author:
- michal.polkorab
-
Method Summary
Modifier and TypeMethodDescription<T extends OFGeneralDeserializer>
TGets the deserializer for the given key.void
init()
Initializes deserializers.void
registerDeserializer
(MessageCodeKey key, OFGeneralDeserializer deserializer) Registers a deserializer.boolean
Unregisters a deserializer.
-
Method Details
-
init
void init()Initializes deserializers. -
getDeserializer
Gets the deserializer for the given key.- Type Parameters:
T
- type of particular deserializer- Parameters:
key
- used for deserializer lookup- Returns:
- deserializer found
-
registerDeserializer
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
Unregisters a deserializer.- Parameters:
key
- used for deserializer lookup- Returns:
- true if deserializer was removed, false if no deserializer was found under specified key
-