Enum Class MessageType

java.lang.Object
java.lang.Enum<MessageType>
io.micronaut.jms.model.MessageType
All Implemented Interfaces:
Serializable, Comparable<MessageType>, Constable

public enum MessageType extends Enum<MessageType>
The underlying type of a Message mapped to the corresponding class.
Since:
1.0.0
Author:
Elliott Pope
See Also:
  • Enum Constant Details

    • TEXT

      public static final MessageType TEXT
      A TextMessage to be deserialized to a String.
    • MAP

      public static final MessageType MAP
      A MapMessage to be deserialized to a Map.
    • BYTES

      public static final MessageType BYTES
      A BytesMessage to be deserialized to a byte array.
    • STREAM

      public static final MessageType STREAM
      A StreamMessage. JMS 2.0 only. Cannot deserialize, must be done by the client.
    • OBJECT

      public static final MessageType OBJECT
      An ObjectMessage to be deserialized to a Serializable.
    • UNKNOWN

      public static final MessageType UNKNOWN
      The default case if no known Message subtype is known for the incoming message.
  • Method Details

    • values

      public static MessageType[] 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

      public static MessageType valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • fromMessage

      @NonNull public static @NonNull MessageType fromMessage(@Nullable @Nullable jakarta.jms.Message message)
      Determine the MessageType corresponding to the given message. Returns UNKNOWN if the message is null or the type is not supported.
      Parameters:
      message - the Message whose type you would like to infer.
      Returns:
      the MessageType
    • fromObject

      public static MessageType fromObject(Object message)
      Determine the MessageType corresponding to the given message. Returns UNKNOWN if the message is null or OBJECT otherwise.
      Parameters:
      message - the Message whose type you would like to infer.
      Returns:
      the MessageType