Record Class SimpleChannel.SimpleContext<BUF extends FriendlyByteBuf,BASE>

java.lang.Object
java.lang.Record
net.minecraftforge.network.SimpleChannel.SimpleContext<BUF,BASE>
Enclosing class:
SimpleChannel

private static record SimpleChannel.SimpleContext<BUF extends FriendlyByteBuf,BASE>(SimpleChannel channel, @Nullable NetworkProtocol<BUF extends FriendlyByteBuf> protocol, @Nullable PacketFlow flow) extends Record
  • Field Details

    • channel

      private final SimpleChannel channel
      The field for the channel record component.
    • protocol

      @Nullable private final @Nullable NetworkProtocol<BUF extends FriendlyByteBuf> protocol
      The field for the protocol record component.
    • flow

      @Nullable private final @Nullable PacketFlow flow
      The field for the flow record component.
  • Constructor Details

    • SimpleContext

      public SimpleContext(SimpleChannel channel)
    • SimpleContext

      private SimpleContext(SimpleChannel channel, @Nullable @Nullable NetworkProtocol<BUF> protocol, @Nullable @Nullable PacketFlow flow)
      Creates an instance of a SimpleContext record class.
      Parameters:
      channel - the value for the channel record component
      protocol - the value for the protocol record component
      flow - the value for the flow record component
  • Method Details

    • protocol

      public <NEWBUF extends FriendlyByteBuf> SimpleChannel.SimpleContext<NEWBUF,BASE> protocol(NetworkProtocol<NEWBUF> protocol)
    • flow

      private SimpleChannel.SimpleContext<BUF,BASE> flow(@Nullable @Nullable PacketFlow flow)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • channel

      public SimpleChannel channel()
      Returns the value of the channel record component.
      Returns:
      the value of the channel record component
    • protocol

      @Nullable public @Nullable NetworkProtocol<BUF> protocol()
      Returns the value of the protocol record component.
      Returns:
      the value of the protocol record component
    • flow

      @Nullable public @Nullable PacketFlow flow()
      Returns the value of the flow record component.
      Returns:
      the value of the flow record component