PacketConsumer.Packet


public interface PacketConsumer.Packet<T extends Object>


Represents a data packet that wraps a payload.

Parameters
<T extends Object>

The type of the payload contained within the packet.

Summary

Public methods

abstract @NonNull T

The data carried by this packet.

default static final @NonNull PacketConsumer.Packet<@NonNull T>
<T extends Object> of(@NonNull T payload)

Creates a default, immutable Packet implementation.

Public methods

getPayload

abstract @NonNullgetPayload()

The data carried by this packet.

of

default static final @NonNull PacketConsumer.Packet<@NonNull T> <T extends Object> of(@NonNull T payload)

Creates a default, immutable Packet implementation.

Parameters
@NonNull T payload

The data to be carried by the packet.

Returns
@NonNull PacketConsumer.Packet<@NonNull T>

A new Packet instance wrapping the payload.