Enum MessageFormat

java.lang.Object
java.lang.Enum<MessageFormat>
de.otto.synapse.translator.MessageFormat
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<MessageFormat>, java.lang.constant.Constable

public enum MessageFormat
extends java.lang.Enum<MessageFormat>
Identifies the format used to encode or decode messages.
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    java.lang.Enum.EnumDesc<E extends java.lang.Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant Description
    V1
    String representation of the message only contains the message payload; no header attributes supported.
    V2
    String representation of the message contains version, header attributes and payload in JSON format
  • Field Summary

    Fields
    Modifier and Type Field Description
    static java.lang.String SYNAPSE_MSG_COMPACTIONKEY  
    static java.lang.String SYNAPSE_MSG_FORMAT  
    static java.lang.String SYNAPSE_MSG_HEADERS  
    static java.lang.String SYNAPSE_MSG_KEY  
    static java.lang.String SYNAPSE_MSG_PARTITIONKEY  
    static java.lang.String SYNAPSE_MSG_PAYLOAD  
  • Method Summary

    Modifier and Type Method Description
    static MessageFormat defaultMessageFormat()
    Returns the default message format used by Synapse to encode messages.
    static MessageFormat valueOf​(java.lang.String name)
    Returns the enum constant of this type with the specified name.
    static MessageFormat[] values()
    Returns an array containing the constants of this enum type, in the order they are declared.
    static MessageFormat versionOf​(java.lang.String message)
    Determines the MessageFormat from the string representation of some message.

    Methods inherited from class java.lang.Enum

    clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • V1

      public static final MessageFormat V1
      String representation of the message only contains the message payload; no header attributes supported.
    • V2

      public static final MessageFormat V2
      String representation of the message contains version, header attributes and payload in JSON format
  • Field Details

    • SYNAPSE_MSG_FORMAT

      public static final java.lang.String SYNAPSE_MSG_FORMAT
      See Also:
      Constant Field Values
    • SYNAPSE_MSG_KEY

      public static final java.lang.String SYNAPSE_MSG_KEY
      See Also:
      Constant Field Values
    • SYNAPSE_MSG_COMPACTIONKEY

      public static final java.lang.String SYNAPSE_MSG_COMPACTIONKEY
      See Also:
      Constant Field Values
    • SYNAPSE_MSG_PARTITIONKEY

      public static final java.lang.String SYNAPSE_MSG_PARTITIONKEY
      See Also:
      Constant Field Values
    • SYNAPSE_MSG_HEADERS

      public static final java.lang.String SYNAPSE_MSG_HEADERS
      See Also:
      Constant Field Values
    • SYNAPSE_MSG_PAYLOAD

      public static final java.lang.String SYNAPSE_MSG_PAYLOAD
      See Also:
      Constant Field Values
  • Method Details

    • values

      public static MessageFormat[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static MessageFormat valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
      java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
      java.lang.NullPointerException - if the argument is null
    • defaultMessageFormat

      public static MessageFormat defaultMessageFormat()
      Returns the default message format used by Synapse to encode messages.
      Returns:
      the default message format
    • versionOf

      public static MessageFormat versionOf​(java.lang.String message)
      Determines the MessageFormat from the string representation of some message.
      Parameters:
      message - the string representation of some message
      Returns:
      MessageFormat of the message