Package devs.beer.nativepackets.api
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 Summary
ConstructorsConstructorDescriptionPacketListenerInfo(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 aPacketListenerInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanactive()Returns the value of theactiverecord component.Returns the value of thedirectionrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefailurePolicyrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of thenativePacketClassNamerecord component.Returns the value of theownerTyperecord component.Returns the value of thepacketTypeKeyrecord component.phase()Returns the value of thephaserecord component.priority()Returns the value of thepriorityrecord component.booleanreadOnly()Reports whether this registration is a final read-only monitor.booleanReturns the value of thereceiveCancelledrecord component.longReturns the value of theregistrationIdrecord component.selector()Returns the value of theselectorrecord component.final StringtoString()Returns a string representation of this record class.
-
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 aPacketListenerInforecord class.- Parameters:
registrationId- the value for theregistrationIdrecord componentownerType- the value for theownerTyperecord componentselector- the value for theselectorrecord componentdirection- the value for thedirectionrecord componentphase- the value for thephaserecord componentpacketTypeKey- the value for thepacketTypeKeyrecord componentnativePacketClassName- the value for thenativePacketClassNamerecord componentpriority- the value for thepriorityrecord componentfailurePolicy- the value for thefailurePolicyrecord componentreceiveCancelled- the value for thereceiveCancelledrecord componentactive- the value for theactiverecord component
-
-
Method Details
-
readOnly
public boolean readOnly()Reports whether this registration is a final read-only monitor. -
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 '=='. -
registrationId
public long registrationId()Returns the value of theregistrationIdrecord component.- Returns:
- the value of the
registrationIdrecord component
-
ownerType
Returns the value of theownerTyperecord component.- Returns:
- the value of the
ownerTyperecord component
-
selector
Returns the value of theselectorrecord component.- Returns:
- the value of the
selectorrecord component
-
direction
Returns the value of thedirectionrecord component.- Returns:
- the value of the
directionrecord component
-
phase
Returns the value of thephaserecord component.- Returns:
- the value of the
phaserecord component
-
packetTypeKey
Returns the value of thepacketTypeKeyrecord component.- Returns:
- the value of the
packetTypeKeyrecord component
-
nativePacketClassName
Returns the value of thenativePacketClassNamerecord component.- Returns:
- the value of the
nativePacketClassNamerecord component
-
priority
Returns the value of thepriorityrecord component.- Returns:
- the value of the
priorityrecord component
-
failurePolicy
Returns the value of thefailurePolicyrecord component.- Returns:
- the value of the
failurePolicyrecord component
-
receiveCancelled
public boolean receiveCancelled()Returns the value of thereceiveCancelledrecord component.- Returns:
- the value of the
receiveCancelledrecord component
-
active
public boolean active()Returns the value of theactiverecord component.- Returns:
- the value of the
activerecord component
-