public enum MessageType extends java.lang.Enum<MessageType>
Message
mapped to the corresponding class.Deserializer
,
Serializer
,
Message
,
TextMessage
Enum Constant and Description |
---|
BYTES
A
BytesMessage to be deserialized to a byte array. |
MAP
A
MapMessage to be deserialized to a Map . |
OBJECT
An
ObjectMessage to be deserialized to a Serializable . |
STREAM
A
StreamMessage . |
TEXT
A
TextMessage to be deserialized to a String . |
UNKNOWN
The default case if no known
Message subtype is known for the incoming message. |
Modifier and Type | Method and Description |
---|---|
static MessageType |
fromMessage(javax.jms.Message message)
Determine the
MessageType corresponding to the given
message . |
static MessageType |
fromObject(java.lang.Object message)
Determine the
MessageType corresponding to the given
message . |
static MessageType |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static MessageType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final MessageType TEXT
TextMessage
to be deserialized to a String
.public static final MessageType MAP
MapMessage
to be deserialized to a Map
.public static final MessageType OBJECT
ObjectMessage
to be deserialized to a Serializable
.public static final MessageType BYTES
BytesMessage
to be deserialized to a byte array.public static final MessageType STREAM
StreamMessage
. JMS 2.0 only. Cannot deserialize, must be done
by the client.public static final MessageType UNKNOWN
Message
subtype is known for the incoming message.public static MessageType[] values()
for (MessageType c : MessageType.values()) System.out.println(c);
public static MessageType valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null@NonNull public static MessageType fromMessage(@Nullable javax.jms.Message message)
MessageType
corresponding to the given
message
. Returns UNKNOWN
if the
message
is null or the type is not supported.message
- the Message
whose type you would like to infer.MessageType
public static MessageType fromObject(java.lang.Object message)
MessageType
corresponding to the given
message
. Returns UNKNOWN
if the
message
is null or OBJECT
otherwise.message
- the Message
whose type you would like to infer.MessageType