Class RestMessage
java.lang.Object
com.aquima.interactions.communication.impl.RestMessage
- All Implemented Interfaces:
IRestMessage
,Serializable
- Direct Known Subclasses:
RestRequestMessage
Rest message implementation.
- Since:
- 9.0
- Author:
- Arjan Pragt
- See Also:
-
Constructor Summary
ConstructorDescriptionConstructs a default empty rest message.RestMessage
(MultiValueMap headers, String body) Construct a rest message with a map with headers and a body. -
Method Summary
Modifier and TypeMethodDescriptiongetBody()
This method returns the body of the message.Returns the mime type of the message, or null if not specified.String[]
This method returns the header names for this request message.protected MultiValueMap
String[]
getHeaderValues
(String name) This method returns the header values for the requested name.protected String
getSingleHeaderValue
(String header) void
setAcceptType
(String mimeType) void
void
setContentType
(String mimeType) void
setHeaders
(MultiValueMap headers) toString()
-
Constructor Details
-
RestMessage
public RestMessage()Constructs a default empty rest message. -
RestMessage
Construct a rest message with a map with headers and a body.- Parameters:
headers
- The map containing header values, may not be null.body
- The body, may be null.
-
-
Method Details
-
getHeaders
-
setBody
-
getBody
Description copied from interface:IRestMessage
This method returns the body of the message.- Specified by:
getBody
in interfaceIRestMessage
- Returns:
- The body of the message, may be null.
-
getHeaderNames
Description copied from interface:IRestMessage
This method returns the header names for this request message.- Specified by:
getHeaderNames
in interfaceIRestMessage
- Returns:
- The header names, never null, but may be an empty array.
-
getHeaderValues
Description copied from interface:IRestMessage
This method returns the header values for the requested name.- Specified by:
getHeaderValues
in interfaceIRestMessage
- Parameters:
name
- name of the header- Returns:
- The header values, may be null.
-
setHeaders
-
getAcceptType
-
setAcceptType
-
getContentType
Description copied from interface:IRestMessage
Returns the mime type of the message, or null if not specified.- Specified by:
getContentType
in interfaceIRestMessage
- Returns:
- The mime type, or null.
-
setContentType
-
getSingleHeaderValue
-
toString
-