Package io.micronaut.jms.model
Enum Class MessageType
- All Implemented Interfaces:
Serializable
,Comparable<MessageType>
,Constable
The underlying type of a
Message
mapped to the corresponding class.- Since:
- 1.0.0
- Author:
- Elliott Pope
- See Also:
-
Deserializer
Serializer
Message
TextMessage
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionABytesMessage
to be deserialized to a byte array.AMapMessage
to be deserialized to aMap
.AnObjectMessage
to be deserialized to aSerializable
.AStreamMessage
.ATextMessage
to be deserialized to aString
.The default case if no knownMessage
subtype is known for the incoming message. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull MessageType
fromMessage
(@Nullable javax.jms.Message message) Determine theMessageType
corresponding to the givenmessage
.static MessageType
fromObject
(Object message) Determine theMessageType
corresponding to the givenmessage
.static MessageType
Returns the enum constant of this class with the specified name.static MessageType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
TEXT
ATextMessage
to be deserialized to aString
. -
MAP
AMapMessage
to be deserialized to aMap
. -
BYTES
ABytesMessage
to be deserialized to a byte array. -
STREAM
AStreamMessage
. JMS 2.0 only. Cannot deserialize, must be done by the client. -
OBJECT
AnObjectMessage
to be deserialized to aSerializable
. -
UNKNOWN
The default case if no knownMessage
subtype is known for the incoming message.
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
fromMessage
@NonNull public static @NonNull MessageType fromMessage(@Nullable @Nullable javax.jms.Message message) Determine theMessageType
corresponding to the givenmessage
. ReturnsUNKNOWN
if themessage
is null or the type is not supported.- Parameters:
message
- theMessage
whose type you would like to infer.- Returns:
- the
MessageType
-
fromObject
Determine theMessageType
corresponding to the givenmessage
. ReturnsUNKNOWN
if themessage
is null orOBJECT
otherwise.- Parameters:
message
- theMessage
whose type you would like to infer.- Returns:
- the
MessageType
-