Package com.consol.citrus.message
Interface Message
-
- All Superinterfaces:
Serializable
public interface Message extends Serializable
- Since:
- 2.0
- Author:
- Christoph Deppisch
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MessageaddHeaderData(String headerData)Adds new header data.ObjectgetHeader(String headerName)Gets the message header value by its header name.List<String>getHeaderData()Gets the list of header data in this message.Map<String,Object>getHeaders()Gets message headers.StringgetId()Gets the unique message id;StringgetName()Gets the message name for internal use;ObjectgetPayload()Gets the message payload.<T> TgetPayload(Class<T> type)Gets message payload with required type conversion.StringgetType()Indicates the type of the message content (e.g.voidremoveHeader(String headerName)Removes the message header if it not a reserved message header such as unique message id.MessagesetHeader(String headerName, Object headerValue)Sets new header entry in message header list.MessagesetName(String name)Sets the message name for internal use.MessagesetPayload(Object payload)Sets the message payload.MessagesetType(String type)Sets the message type indicating the content type.
-
-
-
Method Detail
-
getId
String getId()
Gets the unique message id;- Returns:
-
getType
String getType()
Indicates the type of the message content (e.g. Xml, Json, binary)- Returns:
-
setType
Message setType(String type)
Sets the message type indicating the content type.- Parameters:
type-
-
getName
String getName()
Gets the message name for internal use;- Returns:
-
getHeader
Object getHeader(String headerName)
Gets the message header value by its header name.- Parameters:
headerName-- Returns:
-
setHeader
Message setHeader(String headerName, Object headerValue)
Sets new header entry in message header list.- Parameters:
headerName-headerValue-- Returns:
-
removeHeader
void removeHeader(String headerName)
Removes the message header if it not a reserved message header such as unique message id.- Parameters:
headerName-
-
addHeaderData
Message addHeaderData(String headerData)
Adds new header data.- Parameters:
headerData-- Returns:
-
getPayload
<T> T getPayload(Class<T> type)
Gets message payload with required type conversion.- Type Parameters:
T-- Parameters:
type-- Returns:
-
getPayload
Object getPayload()
Gets the message payload.- Returns:
-
-