java.lang.Object
org.miaixz.bus.http.Stomp.Message
- Enclosing class:
Stomp
Represents a STOMP message.
-
Constructor Summary
ConstructorsConstructorDescriptionMessage(String command, List<Stomp.Header> headers, String payload) Constructs a new STOMP message. -
Method Summary
Modifier and TypeMethodDescriptioncompile(boolean legacyWhitespace) Compiles the message into a string.static Stomp.MessageParses a STOMP message from a string.Gets the message command.Gets the list of message headers.Gets the message payload.Gets a header by its key.headerValue(String key) Gets the value of a header by its key.toString()Returns the string representation of the message.
-
Constructor Details
-
Message
Constructs a new STOMP message.- Parameters:
command- The message command.headers- The list of headers.payload- The message payload.
-
-
Method Details
-
from
Parses a STOMP message from a string.- Parameters:
data- The message string.- Returns:
- The parsed
Stomp.Messageobject, or null if invalid.
-
getHeaders
Gets the list of message headers.- Returns:
- The list of headers.
-
getPayload
Gets the message payload.- Returns:
- The message payload.
-
getCommand
Gets the message command.- Returns:
- The command.
-
headerValue
Gets the value of a header by its key.- Parameters:
key- The header key.- Returns:
- The header value, or null if not found.
-
header
Gets a header by its key.- Parameters:
key- The header key.- Returns:
- The
Stomp.Headerobject, or null if not found.
-
compile
Compiles the message into a string.- Parameters:
legacyWhitespace- Whether to use legacy whitespace formatting.- Returns:
- The compiled message string.
-
toString
Returns the string representation of the message.
-