Module concord_core

Interface Message

All Known Implementing Classes:
Chat, ChatHistoryRequest, ChatHistoryResponse, ClientLogin, ClientRegistration, ClientSessionResume, CreateThread, Error, KeyData, MoveToChannel, RegistrationStatus, ServerMetaData, ServerMetaData.ChannelData, ServerUsers, ServerWelcome, UserData

public interface Message
Represents any message which can be sent over the network.

All messages consist of a single byte type identifier, followed by a payload whose structure depends on the message.

  • Method Summary

    Modifier and Type
    Method
    Description
    default int
    Convenience method to determine the size of this message in bytes.
    default <T extends Message>
    MessageTypeSerializer<T>
    Convenience method to get the serializer for this message's type, using the static auto-generated set of serializers.
  • Method Details

    • getTypeSerializer

      default <T extends Message> MessageTypeSerializer<T> getTypeSerializer()
      Convenience method to get the serializer for this message's type, using the static auto-generated set of serializers.
      Type Parameters:
      T - The message type.
      Returns:
      The serializer to use to read and write messages of this type.
    • byteSize

      default int byteSize()
      Convenience method to determine the size of this message in bytes.
      Returns:
      The size of this message, in bytes.