Record Class BadgeWebSocketMessage

java.lang.Object
java.lang.Record
io.meeds.appcenter.model.BadgeWebSocketMessage
Record Components:
wsEventName - the event name the frontend listens to
message - the event payload

public record BadgeWebSocketMessage(String wsEventName, Map<String,Object> message) extends Record
The frame pushed on the badge WebSocket channel. Its shape matches what $socialWebSocket.initCometd expects: wsEventName names the DOM event the browser dispatches, message carries its detail.

Deliberately carries the badge name only, never the count, so that reading a value always goes back through the authenticated REST endpoint where the ACL is applied.

  • Constructor Details

    • BadgeWebSocketMessage

      public BadgeWebSocketMessage(String wsEventName, Map<String,Object> message)
      Creates an instance of a BadgeWebSocketMessage record class.
      Parameters:
      wsEventName - the value for the wsEventName record component
      message - the value for the message 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • wsEventName

      public String wsEventName()
      Returns the value of the wsEventName record component.
      Returns:
      the value of the wsEventName record component
    • message

      public Map<String,Object> message()
      Returns the value of the message record component.
      Returns:
      the value of the message record component