Package net.minecraftforge.network
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 Summary
FieldsModifier and TypeFieldDescriptionprivate final SimpleChannelThe field for thechannelrecord component.private final @Nullable PacketFlowThe field for theflowrecord component.private final @Nullable NetworkProtocol<BUF> The field for theprotocolrecord component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionSimpleContext(SimpleChannel channel) privateSimpleContext(SimpleChannel channel, @Nullable NetworkProtocol<BUF> protocol, @Nullable PacketFlow flow) Creates an instance of aSimpleContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionchannel()Returns the value of thechannelrecord component.final booleanIndicates whether some other object is "equal to" this one.@Nullable PacketFlowflow()Returns the value of theflowrecord component.private SimpleChannel.SimpleContext<BUF, BASE> flow(@Nullable PacketFlow flow) final inthashCode()Returns a hash code value for this object.@Nullable NetworkProtocol<BUF> protocol()Returns the value of theprotocolrecord component.<NEWBUF extends FriendlyByteBuf>
SimpleChannel.SimpleContext<NEWBUF, BASE> protocol(NetworkProtocol<NEWBUF> protocol) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
channel
The field for thechannelrecord component. -
protocol
The field for theprotocolrecord component. -
flow
The field for theflowrecord component.
-
-
Constructor Details
-
SimpleContext
-
SimpleContext
private SimpleContext(SimpleChannel channel, @Nullable @Nullable NetworkProtocol<BUF> protocol, @Nullable @Nullable PacketFlow flow) Creates an instance of aSimpleContextrecord class.- Parameters:
channel- the value for thechannelrecord componentprotocol- the value for theprotocolrecord componentflow- the value for theflowrecord component
-
-
Method Details
-
protocol
public <NEWBUF extends FriendlyByteBuf> SimpleChannel.SimpleContext<NEWBUF,BASE> protocol(NetworkProtocol<NEWBUF> protocol) -
flow
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
channel
Returns the value of thechannelrecord component.- Returns:
- the value of the
channelrecord component
-
protocol
Returns the value of theprotocolrecord component.- Returns:
- the value of the
protocolrecord component
-
flow
Returns the value of theflowrecord component.- Returns:
- the value of the
flowrecord component
-