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
Modifier and TypeFieldDescriptionprivate final SimpleChannel
The field for thechannel
record component.private final @Nullable PacketFlow
The field for theflow
record component.private final @Nullable NetworkProtocol
<BUF> The field for theprotocol
record component. -
Constructor Summary
ModifierConstructorDescriptionSimpleContext
(SimpleChannel channel) private
SimpleContext
(SimpleChannel channel, @Nullable NetworkProtocol<BUF> protocol, @Nullable PacketFlow flow) Creates an instance of aSimpleContext
record class. -
Method Summary
Modifier and TypeMethodDescriptionchannel()
Returns the value of thechannel
record component.final boolean
Indicates whether some other object is "equal to" this one.@Nullable PacketFlow
flow()
Returns the value of theflow
record component.private SimpleChannel.SimpleContext
<BUF, BASE> flow
(@Nullable PacketFlow flow) final int
hashCode()
Returns a hash code value for this object.@Nullable NetworkProtocol
<BUF> protocol()
Returns the value of theprotocol
record component.<NEWBUF extends FriendlyByteBuf>
SimpleChannel.SimpleContext<NEWBUF, BASE> protocol
(NetworkProtocol<NEWBUF> protocol) final String
toString()
Returns a string representation of this record class.
-
Field Details
-
channel
The field for thechannel
record component. -
protocol
The field for theprotocol
record component. -
flow
The field for theflow
record component.
-
-
Constructor Details
-
SimpleContext
-
SimpleContext
private SimpleContext(SimpleChannel channel, @Nullable @Nullable NetworkProtocol<BUF> protocol, @Nullable @Nullable PacketFlow flow) Creates an instance of aSimpleContext
record class.- Parameters:
channel
- the value for thechannel
record componentprotocol
- the value for theprotocol
record componentflow
- the value for theflow
record 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 thechannel
record component.- Returns:
- the value of the
channel
record component
-
protocol
Returns the value of theprotocol
record component.- Returns:
- the value of the
protocol
record component
-
flow
Returns the value of theflow
record component.- Returns:
- the value of the
flow
record component
-