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

    Fields
    Modifier and Type
    Field
    Description
    private final boolean
    The field for the compressed record component.
    private final BiFunction<io.netty.buffer.ByteBuf,Integer,Packet>
    The field for the deserialize record component.
    private final int
    The field for the fixedBlockSize record component.
    private final int
    The field for the id record component.
    private final int
    The field for the maxSize record component.
    private final String
    The field for the name record component.
    private final Class<? extends Packet>
    The field for the type record component.
    private final BiFunction<io.netty.buffer.ByteBuf,Integer,ValidationResult>
    The field for the validate record component.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PacketInfo(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 a PacketInfo record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns the value of the compressed record component.
    BiFunction<io.netty.buffer.ByteBuf,Integer,Packet>
    Returns the value of the deserialize record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    int
    Returns the value of the fixedBlockSize record component.
    final int
    Returns a hash code value for this object.
    int
    id()
    Returns the value of the id record component.
    int
    Returns the value of the maxSize record component.
    Returns the value of the name record component.
    final String
    Returns a string representation of this record class.
    Class<? extends Packet>
    Returns the value of the type record component.
    BiFunction<io.netty.buffer.ByteBuf,Integer,ValidationResult>
    Returns the value of the validate record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • id

      private final int id
      The field for the id record component.
    • name

      @Nonnull private final String name
      The field for the name record component.
    • type

      @Nonnull private final Class<? extends Packet> type
      The field for the type record component.
    • fixedBlockSize

      private final int fixedBlockSize
      The field for the fixedBlockSize record component.
    • maxSize

      private final int maxSize
      The field for the maxSize record component.
    • compressed

      private final boolean compressed
      The field for the compressed record component.
    • validate

      @Nonnull private final BiFunction<io.netty.buffer.ByteBuf,Integer,ValidationResult> validate
      The field for the validate record component.
    • deserialize

      @Nonnull private final BiFunction<io.netty.buffer.ByteBuf,Integer,Packet> deserialize
      The field for the deserialize record 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 a PacketInfo record class.
      Parameters:
      id - the value for the id record component
      name - the value for the name record component
      type - the value for the type record component
      fixedBlockSize - the value for the fixedBlockSize record component
      maxSize - the value for the maxSize record component
      compressed - the value for the compressed record component
      validate - the value for the validate record component
      deserialize - the value for the deserialize record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • id

      public int id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • name

      @Nonnull public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • type

      @Nonnull public Class<? extends Packet> type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • fixedBlockSize

      public int fixedBlockSize()
      Returns the value of the fixedBlockSize record component.
      Returns:
      the value of the fixedBlockSize record component
    • maxSize

      public int maxSize()
      Returns the value of the maxSize record component.
      Returns:
      the value of the maxSize record component
    • compressed

      public boolean compressed()
      Returns the value of the compressed record component.
      Returns:
      the value of the compressed record component
    • validate

      @Nonnull public BiFunction<io.netty.buffer.ByteBuf,Integer,ValidationResult> validate()
      Returns the value of the validate record component.
      Returns:
      the value of the validate record component
    • deserialize

      @Nonnull public BiFunction<io.netty.buffer.ByteBuf,Integer,Packet> deserialize()
      Returns the value of the deserialize record component.
      Returns:
      the value of the deserialize record component