Package com.io7m.cedarbridge.runtime.api

# Interface CBProtocolType<T extends CBProtocolMessageType>

Type Parameters:
  `T` - The type of messages

All Known Implementing Classes:
  `CBAbstractProtocol`

public interface CBProtocolType<T extends CBProtocolMessageType>
The base type of protocols.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Class<T>`
  `messageClass()`
  `UUID`
  `protocolId()`
  `SortedSet<CBProtocolCoordinates>`
  `protocols()`
  `SortedSet<BigInteger>`
  `protocolVersions()`
  `Optional<CBProtocolMessageVersionedSerializerType<T>>`
  `serializerForMessageClass(Class<T> messageClass)`
  Retrieve a serializer for the given message class.
  `default Optional<CBProtocolMessageVersionedSerializerType<T>>`
  `serializerForProtocolVersion(long version)`
  Retrieve a serializer for the given protocol version.
  `Optional<CBProtocolMessageVersionedSerializerType<T>>`
  `serializerForProtocolVersion(BigInteger version)`
  Retrieve a serializer for the given protocol version.

- ## Method Details

  - ### messageClass

    Class<T> messageClass()
    Returns:
      The type of messages in this protocol

  - ### protocolId

    UUID protocolId()
    Returns:
      The unique protocol identifier

  - ### serializerForMessageClass

    Optional<CBProtocolMessageVersionedSerializerType<T>> serializerForMessageClass(Class<T> messageClass)
    Retrieve a serializer for the given message class.
    Parameters:
      `messageClass` - The message class
    Returns:
      A serializer, if one is available

  - ### serializerForProtocolVersion

    Optional<CBProtocolMessageVersionedSerializerType<T>> serializerForProtocolVersion(BigInteger version)
    Retrieve a serializer for the given protocol version.
    Parameters:
      `version` - The protocol version
    Returns:
      A serializer, if one is available

  - ### serializerForProtocolVersion

    default Optional<CBProtocolMessageVersionedSerializerType<T>> serializerForProtocolVersion(long version)
    Retrieve a serializer for the given protocol version.
    Parameters:
      `version` - The protocol version
    Returns:
      A serializer, if one is available

  - ### protocols

    SortedSet<CBProtocolCoordinates> protocols()
    Returns:
      The set of protocol coordinates for this protocol

  - ### protocolVersions

    SortedSet<BigInteger> protocolVersions()
    Returns:
      The set of protocol versions for this protocol