Interface SerializerRegistry

All Known Implementing Classes:
SerializerRegistryImpl

public interface SerializerRegistry
Stores and handles serializers.
K - MessageTypeKey parameter type,
S - returned serializer type
Author:
michal.polkorab
  • Method Details

    • init

      void init()
      Serializer registry provisioning.
    • getSerializer

      <K, S extends OFGeneralSerializer> S getSerializer(MessageTypeKey<K> msgTypeKey)
      Gets the serializer for the given type.
      Type Parameters:
      K - input key type
      S - type of resulting serializer
      Parameters:
      msgTypeKey - lookup key
      Returns:
      serializer or NullPointerException if no serializer was found
    • registerSerializer

      <K> void registerSerializer(MessageTypeKey<K> key, OFGeneralSerializer serializer)
      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 lookup
      serializer - serializer implementation
      Throws:
      IllegalStateException - when there is a serializer already registered under given key
    • unregisterSerializer

      <K> boolean unregisterSerializer(MessageTypeKey<K> key)
      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