public class Message
extends java.lang.Object
Messages are generated as a result of requests to the API and contain both a message body and meta data about that message.
Messages are found on the Response
via the Response.getResponseMessages()
accessor method.
Messages have a number of meta-data properties, including:
Response
,
ResponseMessages
Modifier and Type | Class and Description |
---|---|
static class |
Message.Code
The secondary machine readable categorization of messages.
|
static class |
Message.MessageType
The primary machine readable categorization of messages.
|
static class |
Message.Severity
The message severity.
|
Constructor and Description |
---|
Message(Message.Severity severity,
Message.MessageType type,
Message.Code code,
java.lang.String message) |
Message(Message.Severity severity,
Message.MessageType type,
Message.Code code,
java.lang.String message,
java.util.Map<java.lang.String,java.lang.Object> ancillaryData) |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.Object> |
getAncillaryData()
Returns the context dependent ancillary data for this message,
if any exists.
|
Message.Code |
getCode()
Returns the optional secondary machine readable message categorization.
|
java.lang.String |
getMessage()
Returns the human readable body text of the message.
|
Message.Severity |
getSeverity()
Returns the message severity.
|
Message.MessageType |
getType()
Returns the primary machine readable message categorization.
|
java.lang.String |
toString() |
public Message(Message.Severity severity, Message.MessageType type, Message.Code code, java.lang.String message)
public Message(Message.Severity severity, Message.MessageType type, Message.Code code, java.lang.String message, java.util.Map<java.lang.String,java.lang.Object> ancillaryData)
public Message.Severity getSeverity()
public Message.MessageType getType()
public Message.Code getCode()
public java.lang.String getMessage()
public java.util.Map<java.lang.String,java.lang.Object> getAncillaryData()
Returns the context dependent ancillary data for this message, if any exists.
Most messages do not contain any ancillary data; however the occasional message does have extra data associated with it. While the keys present, and the types for the values, will vary between message types, for any given message type these properties can be expected to stay consistent.
public java.lang.String toString()
toString
in class java.lang.Object