Package com.io7m.idstore.protocol.api

# Interface IdProtocolMessagesType<T extends IdProtocolMessageType>

Type Parameters:
  `T` - The type of protocol messages

All Known Implementing Classes:
  `IdACB1Messages`, `IdUCB1Messages`

public interface IdProtocolMessagesType<T extends IdProtocolMessageType>
The interface exposed by protocol message handlers.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `T`
  `parse(byte[] data)`
  Parse a message from the given bytes.
  `byte[]`
  `serialize(T message)`
  Serialize the given message to a byte array.

- ## Method Details

  - ### parse

    T parse(byte[] data) throws IdProtocolException
    Parse a message from the given bytes.
    Parameters:
      `data` - The bytes
    Returns:
      A parsed message
    Throws:
      `IdProtocolException` - If parsing fails

  - ### serialize

    byte[] serialize(T message)
    Serialize the given message to a byte array.
    Parameters:
      `message` - The message
    Returns:
      The serialized message as a byte array