Interface DeserializerRegistry

  • All Known Implementing Classes:
    DeserializerRegistryImpl

    public interface DeserializerRegistry
    Registry for deserializers.
    Author:
    michal.polkorab
    • 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 lookup
        deserializer - 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