Package de.otto.synapse.translator
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.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringSYNAPSE_MSG_COMPACTIONKEYstatic java.lang.StringSYNAPSE_MSG_FORMATstatic java.lang.StringSYNAPSE_MSG_HEADERSstatic java.lang.StringSYNAPSE_MSG_KEYstatic java.lang.StringSYNAPSE_MSG_PARTITIONKEYstatic java.lang.StringSYNAPSE_MSG_PAYLOAD
-
Method Summary
Modifier and Type Method Description static MessageFormatdefaultMessageFormat()Returns the default message format used by Synapse to encode messages.static MessageFormatvalueOf(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 MessageFormatversionOf(java.lang.String message)Determines theMessageFormatfrom the string representation of some message.
-
-
-
Enum Constant Detail
-
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 Detail
-
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 Detail
-
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 namejava.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 theMessageFormatfrom the string representation of some message.- Parameters:
message- the string representation of some message- Returns:
- MessageFormat of the message
-
-