Module bus.http

Class Stomp.Message

java.lang.Object
org.miaixz.bus.http.Stomp.Message
Enclosing class:
Stomp

public static class Stomp.Message extends Object
Represents a STOMP message.
  • Constructor Details

    • Message

      public Message(String command, List<Stomp.Header> headers, String payload)
      Constructs a new STOMP message.
      Parameters:
      command - The message command.
      headers - The list of headers.
      payload - The message payload.
  • Method Details

    • from

      public static Stomp.Message from(String data)
      Parses a STOMP message from a string.
      Parameters:
      data - The message string.
      Returns:
      The parsed Stomp.Message object, or null if invalid.
    • getHeaders

      public List<Stomp.Header> getHeaders()
      Gets the list of message headers.
      Returns:
      The list of headers.
    • getPayload

      public String getPayload()
      Gets the message payload.
      Returns:
      The message payload.
    • getCommand

      public String getCommand()
      Gets the message command.
      Returns:
      The command.
    • headerValue

      public String headerValue(String key)
      Gets the value of a header by its key.
      Parameters:
      key - The header key.
      Returns:
      The header value, or null if not found.
    • header

      public Stomp.Header header(String key)
      Gets a header by its key.
      Parameters:
      key - The header key.
      Returns:
      The Stomp.Header object, or null if not found.
    • compile

      public String compile(boolean legacyWhitespace)
      Compiles the message into a string.
      Parameters:
      legacyWhitespace - Whether to use legacy whitespace formatting.
      Returns:
      The compiled message string.
    • toString

      public String toString()
      Returns the string representation of the message.
      Overrides:
      toString in class Object
      Returns:
      a string containing the command, headers, and payload.