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:
-
DeserializerSerializerMessageTextMessage
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionABytesMessageto be deserialized to a byte array.AMapMessageto be deserialized to aMap.AnObjectMessageto be deserialized to aSerializable.AStreamMessage.ATextMessageto be deserialized to aString.The default case if no knownMessagesubtype is known for the incoming message. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull MessageTypefromMessage(@Nullable javax.jms.Message message) Determine theMessageTypecorresponding to the givenmessage.static MessageTypefromObject(Object message) Determine theMessageTypecorresponding to the givenmessage.static MessageTypeReturns 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
ATextMessageto be deserialized to aString. -
MAP
AMapMessageto be deserialized to aMap. -
BYTES
ABytesMessageto be deserialized to a byte array. -
STREAM
AStreamMessage. JMS 2.0 only. Cannot deserialize, must be done by the client. -
OBJECT
AnObjectMessageto be deserialized to aSerializable. -
UNKNOWN
The default case if no knownMessagesubtype 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 theMessageTypecorresponding to the givenmessage. ReturnsUNKNOWNif themessageis null or the type is not supported.- Parameters:
message- theMessagewhose type you would like to infer.- Returns:
- the
MessageType
-
fromObject
Determine theMessageTypecorresponding to the givenmessage. ReturnsUNKNOWNif themessageis null orOBJECTotherwise.- Parameters:
message- theMessagewhose type you would like to infer.- Returns:
- the
MessageType
-