Record Class ClientHandshakePacket
java.lang.Object
java.lang.Record
net.minestom.server.network.packet.client.handshake.ClientHandshakePacket
- All Implemented Interfaces:
ClientPacket
public record ClientHandshakePacket(int protocolVersion, @NotNull String serverAddress, int serverPort, @NotNull ClientHandshakePacket.Intent intent)
extends Record
implements ClientPacket
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ConstructorDescriptionClientHandshakePacket
(int protocolVersion, @NotNull String serverAddress, int serverPort, @NotNull ClientHandshakePacket.Intent intent) Creates an instance of aClientHandshakePacket
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.@NotNull ClientHandshakePacket.Intent
intent()
Returns the value of theintent
record component.int
Returns the value of theprotocolVersion
record component.@NotNull String
Returns the value of theserverAddress
record component.int
Returns the value of theserverPort
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
SERIALIZER
-
-
Constructor Details
-
ClientHandshakePacket
public ClientHandshakePacket(int protocolVersion, @NotNull @NotNull String serverAddress, int serverPort, @NotNull @NotNull ClientHandshakePacket.Intent intent) Creates an instance of aClientHandshakePacket
record class.- Parameters:
protocolVersion
- the value for theprotocolVersion
record componentserverAddress
- the value for theserverAddress
record componentserverPort
- the value for theserverPort
record componentintent
- the value for theintent
record component
-
-
Method Details
-
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 '=='. -
protocolVersion
public int protocolVersion()Returns the value of theprotocolVersion
record component.- Returns:
- the value of the
protocolVersion
record component
-
serverAddress
Returns the value of theserverAddress
record component.- Returns:
- the value of the
serverAddress
record component
-
serverPort
public int serverPort()Returns the value of theserverPort
record component.- Returns:
- the value of the
serverPort
record component
-
intent
Returns the value of theintent
record component.- Returns:
- the value of the
intent
record component
-