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 NetworkChannel channel, @Nonnull Class<? extends Packet> type, int fixedBlockSize, int maxSize, boolean compressed, PacketRegistry.DeserializeFunc<MemorySegment> toObject) extends Record
  • Constructor Details

    • PacketInfo

      public PacketInfo(int id, @Nonnull String name, @Nonnull NetworkChannel channel, @Nonnull Class<? extends Packet> type, int fixedBlockSize, int maxSize, boolean compressed, PacketRegistry.DeserializeFunc<MemorySegment> toObject)
      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
      channel - the value for the channel 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
      toObject - the value for the toObject 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 the compare method from their corresponding wrapper classes.
      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
    • channel

      @Nonnull public NetworkChannel channel()
      Returns the value of the channel record component.
      Returns:
      the value of the channel 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
    • toObject

      Returns the value of the toObject record component.
      Returns:
      the value of the toObject record component