Package com.hypixel.hytale.protocol
Record Class PacketRegistry.PacketInfo
java.lang.Object
java.lang.Record
com.hypixel.hytale.protocol.PacketRegistry.PacketInfo
- Enclosing class:
PacketRegistry
public static record PacketRegistry.PacketInfo(int id, @Nonnull String name, @Nonnull Class<? extends Packet> type, int fixedBlockSize, int maxSize, boolean compressed, @Nonnull BiFunction<io.netty.buffer.ByteBuf,Integer,ValidationResult> validate, @Nonnull BiFunction<io.netty.buffer.ByteBuf,Integer,Packet> deserialize)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanThe field for thecompressedrecord component.private final BiFunction<io.netty.buffer.ByteBuf, Integer, Packet> The field for thedeserializerecord component.private final intThe field for thefixedBlockSizerecord component.private final intThe field for theidrecord component.private final intThe field for themaxSizerecord component.private final StringThe field for thenamerecord component.The field for thetyperecord component.private final BiFunction<io.netty.buffer.ByteBuf, Integer, ValidationResult> The field for thevalidaterecord component. -
Constructor Summary
ConstructorsConstructorDescriptionPacketInfo(int id, String name, Class<? extends Packet> type, int fixedBlockSize, int maxSize, boolean compressed, BiFunction<io.netty.buffer.ByteBuf, Integer, ValidationResult> validate, BiFunction<io.netty.buffer.ByteBuf, Integer, Packet> deserialize) Creates an instance of aPacketInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thecompressedrecord component.BiFunction<io.netty.buffer.ByteBuf, Integer, Packet> Returns the value of thedeserializerecord component.final booleanIndicates whether some other object is "equal to" this one.intReturns the value of thefixedBlockSizerecord component.final inthashCode()Returns a hash code value for this object.intid()Returns the value of theidrecord component.intmaxSize()Returns the value of themaxSizerecord component.name()Returns the value of thenamerecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.BiFunction<io.netty.buffer.ByteBuf, Integer, ValidationResult> validate()Returns the value of thevalidaterecord component.
-
Field Details
-
id
private final int idThe field for theidrecord component. -
name
The field for thenamerecord component. -
type
The field for thetyperecord component. -
fixedBlockSize
private final int fixedBlockSizeThe field for thefixedBlockSizerecord component. -
maxSize
private final int maxSizeThe field for themaxSizerecord component. -
compressed
private final boolean compressedThe field for thecompressedrecord component. -
validate
The field for thevalidaterecord component. -
deserialize
The field for thedeserializerecord component.
-
-
Constructor Details
-
PacketInfo
public PacketInfo(int id, @Nonnull String name, @Nonnull Class<? extends Packet> type, int fixedBlockSize, int maxSize, boolean compressed, @Nonnull BiFunction<io.netty.buffer.ByteBuf, Integer, ValidationResult> validate, @Nonnull BiFunction<io.netty.buffer.ByteBuf, Integer, Packet> deserialize) Creates an instance of aPacketInforecord class.- Parameters:
id- the value for theidrecord componentname- the value for thenamerecord componenttype- the value for thetyperecord componentfixedBlockSize- the value for thefixedBlockSizerecord componentmaxSize- the value for themaxSizerecord componentcompressed- the value for thecompressedrecord componentvalidate- the value for thevalidaterecord componentdeserialize- the value for thedeserializerecord 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 '=='. -
id
public int id()Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
fixedBlockSize
public int fixedBlockSize()Returns the value of thefixedBlockSizerecord component.- Returns:
- the value of the
fixedBlockSizerecord component
-
maxSize
public int maxSize()Returns the value of themaxSizerecord component.- Returns:
- the value of the
maxSizerecord component
-
compressed
public boolean compressed()Returns the value of thecompressedrecord component.- Returns:
- the value of the
compressedrecord component
-
validate
Returns the value of thevalidaterecord component.- Returns:
- the value of the
validaterecord component
-
deserialize
Returns the value of thedeserializerecord component.- Returns:
- the value of the
deserializerecord component
-