Record Class PacketListenerInfo

java.lang.Object
java.lang.Record
devs.beer.nativepackets.api.PacketListenerInfo

public record PacketListenerInfo(long registrationId, String ownerType, String selector, PacketDirection direction, ProtocolPhase phase, String packetTypeKey, String nativePacketClassName, ListenerPriority priority, ListenerFailurePolicy failurePolicy, boolean receiveCancelled, boolean active) extends Record
Immutable, classloader-safe metadata copied from one listener registration. The active flag records state at snapshot creation and does not change afterward.
  • Constructor Details

    • PacketListenerInfo

      public PacketListenerInfo(long registrationId, String ownerType, String selector, PacketDirection direction, ProtocolPhase phase, String packetTypeKey, String nativePacketClassName, ListenerPriority priority, ListenerFailurePolicy failurePolicy, boolean receiveCancelled, boolean active)
      Creates an instance of a PacketListenerInfo record class.
      Parameters:
      registrationId - the value for the registrationId record component
      ownerType - the value for the ownerType record component
      selector - the value for the selector record component
      direction - the value for the direction record component
      phase - the value for the phase record component
      packetTypeKey - the value for the packetTypeKey record component
      nativePacketClassName - the value for the nativePacketClassName record component
      priority - the value for the priority record component
      failurePolicy - the value for the failurePolicy record component
      receiveCancelled - the value for the receiveCancelled record component
      active - the value for the active record component
  • Method Details

    • readOnly

      public boolean readOnly()
      Reports whether this registration is a final read-only monitor.
    • 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.
    • registrationId

      public long registrationId()
      Returns the value of the registrationId record component.
      Returns:
      the value of the registrationId record component
    • ownerType

      public String ownerType()
      Returns the value of the ownerType record component.
      Returns:
      the value of the ownerType record component
    • selector

      public String selector()
      Returns the value of the selector record component.
      Returns:
      the value of the selector record component
    • direction

      public PacketDirection direction()
      Returns the value of the direction record component.
      Returns:
      the value of the direction record component
    • phase

      public ProtocolPhase phase()
      Returns the value of the phase record component.
      Returns:
      the value of the phase record component
    • packetTypeKey

      public String packetTypeKey()
      Returns the value of the packetTypeKey record component.
      Returns:
      the value of the packetTypeKey record component
    • nativePacketClassName

      public String nativePacketClassName()
      Returns the value of the nativePacketClassName record component.
      Returns:
      the value of the nativePacketClassName record component
    • priority

      public ListenerPriority priority()
      Returns the value of the priority record component.
      Returns:
      the value of the priority record component
    • failurePolicy

      public ListenerFailurePolicy failurePolicy()
      Returns the value of the failurePolicy record component.
      Returns:
      the value of the failurePolicy record component
    • receiveCancelled

      public boolean receiveCancelled()
      Returns the value of the receiveCancelled record component.
      Returns:
      the value of the receiveCancelled record component
    • active

      public boolean active()
      Returns the value of the active record component.
      Returns:
      the value of the active record component