Enum Class MessageType

java.lang.Object
java.lang.Enum<MessageType>
dev.onvoid.webrtc.examples.web.model.MessageType
All Implemented Interfaces:
Serializable, Comparable<MessageType>, Constable

public enum MessageType extends Enum<MessageType>
Represents the types of messages exchanged during WebRTC signaling. Each message type corresponds to a specific action or state in the WebRTC connection process.
Author:
Alex Andres
  • Enum Constant Details

    • OFFER

      public static final MessageType OFFER
      WebRTC offer message containing session description.
    • ANSWER

      public static final MessageType ANSWER
      WebRTC answer message containing session description.
    • ICE_CANDIDATE

      public static final MessageType ICE_CANDIDATE
      ICE candidate information for establishing peer connections.
    • JOIN

      public static final MessageType JOIN
      Message indicating a peer joining the signaling session.
    • LEAVE

      public static final MessageType LEAVE
      Message indicating a peer leaving the signaling session.
    • HEARTBEAT

      public static final MessageType HEARTBEAT
      Heartbeat message to maintain connection.
    • HEARTBEAT_ACK

      public static final MessageType HEARTBEAT_ACK
      Acknowledgment response to a heartbeat message.
    • UNKNOWN

      public static final MessageType UNKNOWN
      Fallback type for unrecognized messages.
  • Method Details

    • values

      public static MessageType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MessageType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getValue

      public String getValue()
      Returns the string representation of this message type.
      Returns:
      The string value of this message type
    • fromString

      public static MessageType fromString(String text)
      Finds and returns the message type enum constant that matches the given string.
      Parameters:
      text - The string to convert to a message type
      Returns:
      The matching message type, or UNKNOWN if no match is found