public class Message extends Object implements Serializable
Constructor and Description |
---|
Message(byte[] body)
Construct an instance with the provided body and default
MessageProperties . |
Message(byte[] body,
MessageProperties messageProperties)
Construct an instance with the provided body and properties.
|
Modifier and Type | Method and Description |
---|---|
static void |
addAllowedListPatterns(String... patterns)
Deprecated.
toString() no longer deserializes the body.
|
boolean |
equals(Object obj) |
byte[] |
getBody() |
MessageProperties |
getMessageProperties() |
int |
hashCode() |
static void |
setDefaultEncoding(String encoding)
Set the encoding to use in
toString() when converting the body if
there is no contentEncoding message property present. |
static void |
setMaxBodyLength(int length)
Set the maximum length of a test message body to render as a String in
toString() . |
String |
toString() |
public Message(byte[] body)
MessageProperties
.body
- the body.public Message(byte[] body, MessageProperties messageProperties)
body
- the body.messageProperties
- the properties.@Deprecated public static void addAllowedListPatterns(String... patterns)
patterns
- the patterns.public static void setDefaultEncoding(String encoding)
toString()
when converting the body if
there is no contentEncoding
message property present.encoding
- the encoding to use.public static void setMaxBodyLength(int length)
toString()
. Default 50.length
- the length to render.public byte[] getBody()
public MessageProperties getMessageProperties()