Package org.atmosphere.room
Record Class PresenceEvent
java.lang.Object
java.lang.Record
org.atmosphere.room.PresenceEvent
- Record Components:
type- the event type (JOIN or LEAVE)room- the room where the event occurredmember- the resource that joined or left (null for virtual members)memberInfo- the application-level member identity, or null if not provided
public record PresenceEvent(PresenceEvent.Type type, Room room, AtmosphereResource member, RoomMember memberInfo)
extends Record
Event fired when a member joins or leaves a
Room.- Since:
- 4.0
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionPresenceEvent(PresenceEvent.Type type, Room room, AtmosphereResource member) Convenience constructor without member info.PresenceEvent(PresenceEvent.Type type, Room room, AtmosphereResource member, RoomMember memberInfo) Creates an instance of aPresenceEventrecord class.PresenceEvent(PresenceEvent.Type type, Room room, RoomMember memberInfo) Constructor for virtual member events (no AtmosphereResource). -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanmember()Returns the value of thememberrecord component.Returns the value of thememberInforecord component.room()Returns the value of theroomrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
PresenceEvent
Convenience constructor without member info. -
PresenceEvent
Constructor for virtual member events (no AtmosphereResource). -
PresenceEvent
public PresenceEvent(PresenceEvent.Type type, Room room, AtmosphereResource member, RoomMember memberInfo) Creates an instance of aPresenceEventrecord class.- Parameters:
type- the value for thetyperecord componentroom- the value for theroomrecord componentmember- the value for thememberrecord componentmemberInfo- the value for thememberInforecord component
-
-
Method Details
-
isVirtual
public boolean isVirtual()- Returns:
- true if this event is for a virtual (non-connection) member
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
room
Returns the value of theroomrecord component.- Returns:
- the value of the
roomrecord component
-
member
Returns the value of thememberrecord component.- Returns:
- the value of the
memberrecord component
-
memberInfo
Returns the value of thememberInforecord component.- Returns:
- the value of the
memberInforecord component
-