Interface Message.Packet

All Superinterfaces:
Message<MessageBuffer>, Message.PacketBase<MessageBuffer>
Enclosing interface:
Message<T extends MessageBuffer>

public static interface Message.Packet extends Message.PacketBase<MessageBuffer>
Represents a packet message that includes a packet ID.
  • Method Details

    • of

      static <T extends MessageBuffer, P> Message.PacketWrapped<T,P> of(Object packet)
      Creates a new packet message from the given packet object and direction.
      Parameters:
      packet - the packet object to create the message from
      Returns:
      a new packet message
    • of

      static <T extends MessageBuffer, P> MessageFactory<T,Message.PacketWrapped<T,P>> of(Supplier<P> packetSupplier)
      Creates a new packet message from the given packet supplier.
      Parameters:
      packetSupplier - a supplier that provides the packet object to create the message from
      Returns:
      a new packet message
    • of

      static <T extends MessageBuffer, V, P> MessageFactory<T,Message.PacketWrapped<T,P>> of(Function<T,V> substitutor, Function<V,P> packetSupplier)
      Creates a new packet message from the given substitutor and packet supplier.
      Parameters:
      substitutor - a function that applies to the buffer to get the packet object
      packetSupplier - a function that provides the packet object
      Returns:
      a new packet message factory