Package org.geysermc.geyser.network
Record Class GeyserNetwork.MessageDefinition<T extends org.geysermc.geyser.api.network.message.MessageBuffer,M extends org.geysermc.geyser.api.network.message.Message<T>>
java.lang.Object
java.lang.Record
org.geysermc.geyser.network.GeyserNetwork.MessageDefinition<T,M>
- Enclosing class:
GeyserNetwork
public static record GeyserNetwork.MessageDefinition<T extends org.geysermc.geyser.api.network.message.MessageBuffer,M extends org.geysermc.geyser.api.network.message.Message<T>> (@NonNull org.geysermc.geyser.api.network.message.MessageCodec<T extends org.geysermc.geyser.api.network.message.MessageBuffer> codec, @NonNull org.geysermc.geyser.api.network.message.MessageFactory<T extends org.geysermc.geyser.api.network.message.MessageBuffer,M extends org.geysermc.geyser.api.network.message.Message<T>> messageFactory, @Nullable org.geysermc.geyser.api.network.message.MessageHandler<M extends org.geysermc.geyser.api.network.message.Message<T>> handler, org.geysermc.geyser.api.network.message.MessageHandler.Sided<M extends org.geysermc.geyser.api.network.message.Message<T>> clientboundHandler, org.geysermc.geyser.api.network.message.MessageHandler.Sided<M extends org.geysermc.geyser.api.network.message.Message<T>> serverboundHandler, int priority, @Nullable Integer clientboundPriority, @Nullable Integer serverboundPriority, @Nullable org.geysermc.geyser.api.network.ProtocolState state, @Nullable String tag, @Nullable String beforeTag, @Nullable String afterTag)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionMessageDefinition(@NonNull org.geysermc.geyser.api.network.message.MessageCodec<T> codec, @NonNull org.geysermc.geyser.api.network.message.MessageFactory<T, M> messageFactory, @Nullable org.geysermc.geyser.api.network.message.MessageHandler<M> handler, org.geysermc.geyser.api.network.message.MessageHandler.Sided<M> clientboundHandler, org.geysermc.geyser.api.network.message.MessageHandler.Sided<M> serverboundHandler, int priority, @Nullable Integer clientboundPriority, @Nullable Integer serverboundPriority, @Nullable org.geysermc.geyser.api.network.ProtocolState state, @Nullable String tag, @Nullable String beforeTag, @Nullable String afterTag) Creates an instance of aMessageDefinitionrecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable StringafterTag()Returns the value of theafterTagrecord component.@Nullable StringReturns the value of thebeforeTagrecord component.org.geysermc.geyser.api.network.message.MessageHandler.Sided<M> Returns the value of theclientboundHandlerrecord component.@Nullable IntegerReturns the value of theclientboundPriorityrecord component.@NonNull org.geysermc.geyser.api.network.message.MessageCodec<T> codec()Returns the value of thecodecrecord component.@NonNull TcreateBuffer(byte @NonNull [] data) @NonNull McreateMessage(@NonNull T buffer) final booleanIndicates whether some other object is "equal to" this one.@Nullable org.geysermc.geyser.api.network.message.MessageHandler<M> handler()Returns the value of thehandlerrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of themessageFactoryrecord component.intpriority()Returns the value of thepriorityrecord component.intpriority(@NonNull org.geysermc.geyser.api.network.MessageDirection direction) org.geysermc.geyser.api.network.message.MessageHandler.Sided<M> Returns the value of theserverboundHandlerrecord component.@Nullable IntegerReturns the value of theserverboundPriorityrecord component.@Nullable org.geysermc.geyser.api.network.ProtocolStatestate()Returns the value of thestaterecord component.@Nullable Stringtag()Returns the value of thetagrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MessageDefinition
public MessageDefinition(@NonNull org.geysermc.geyser.api.network.message.MessageCodec<T> codec, @NonNull org.geysermc.geyser.api.network.message.MessageFactory<T, M> messageFactory, @Nullable org.geysermc.geyser.api.network.message.MessageHandler<M> handler, org.geysermc.geyser.api.network.message.MessageHandler.Sided<M> clientboundHandler, org.geysermc.geyser.api.network.message.MessageHandler.Sided<M> serverboundHandler, int priority, @Nullable Integer clientboundPriority, @Nullable Integer serverboundPriority, @Nullable org.geysermc.geyser.api.network.ProtocolState state, @Nullable String tag, @Nullable String beforeTag, @Nullable String afterTag) Creates an instance of aMessageDefinitionrecord class.- Parameters:
codec- the value for thecodecrecord componentmessageFactory- the value for themessageFactoryrecord componenthandler- the value for thehandlerrecord componentclientboundHandler- the value for theclientboundHandlerrecord componentserverboundHandler- the value for theserverboundHandlerrecord componentpriority- the value for thepriorityrecord componentclientboundPriority- the value for theclientboundPriorityrecord componentserverboundPriority- the value for theserverboundPriorityrecord componentstate- the value for thestaterecord componenttag- the value for thetagrecord componentbeforeTag- the value for thebeforeTagrecord componentafterTag- the value for theafterTagrecord component
-
-
Method Details
-
createBuffer
-
createMessage
-
priority
public int priority(@NonNull org.geysermc.geyser.api.network.MessageDirection direction) -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
codec
Returns the value of thecodecrecord component.- Returns:
- the value of the
codecrecord component
-
messageFactory
Returns the value of themessageFactoryrecord component.- Returns:
- the value of the
messageFactoryrecord component
-
handler
Returns the value of thehandlerrecord component.- Returns:
- the value of the
handlerrecord component
-
clientboundHandler
Returns the value of theclientboundHandlerrecord component.- Returns:
- the value of the
clientboundHandlerrecord component
-
serverboundHandler
Returns the value of theserverboundHandlerrecord component.- Returns:
- the value of the
serverboundHandlerrecord component
-
priority
public int priority()Returns the value of thepriorityrecord component.- Returns:
- the value of the
priorityrecord component
-
clientboundPriority
Returns the value of theclientboundPriorityrecord component.- Returns:
- the value of the
clientboundPriorityrecord component
-
serverboundPriority
Returns the value of theserverboundPriorityrecord component.- Returns:
- the value of the
serverboundPriorityrecord component
-
state
public @Nullable org.geysermc.geyser.api.network.ProtocolState state()Returns the value of thestaterecord component.- Returns:
- the value of the
staterecord component
-
tag
Returns the value of thetagrecord component.- Returns:
- the value of the
tagrecord component
-
beforeTag
Returns the value of thebeforeTagrecord component.- Returns:
- the value of the
beforeTagrecord component
-
afterTag
Returns the value of theafterTagrecord component.- Returns:
- the value of the
afterTagrecord component
-