Class RestMessage

java.lang.Object
com.aquima.interactions.communication.impl.RestMessage
All Implemented Interfaces:
IRestMessage, Serializable
Direct Known Subclasses:
RestRequestMessage

public class RestMessage extends Object implements IRestMessage
Rest message implementation.
Since:
9.0
Author:
Arjan Pragt
See Also:
  • Constructor Details

    • RestMessage

      public RestMessage()
      Constructs a default empty rest message.
    • RestMessage

      public RestMessage(MultiValueMap headers, String body)
      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

      protected MultiValueMap getHeaders()
    • setBody

      public void setBody(String body)
    • getBody

      public String getBody()
      Description copied from interface: IRestMessage
      This method returns the body of the message.
      Specified by:
      getBody in interface IRestMessage
      Returns:
      The body of the message, may be null.
    • getHeaderNames

      public String[] getHeaderNames()
      Description copied from interface: IRestMessage
      This method returns the header names for this request message.
      Specified by:
      getHeaderNames in interface IRestMessage
      Returns:
      The header names, never null, but may be an empty array.
    • getHeaderValues

      public String[] getHeaderValues(String name)
      Description copied from interface: IRestMessage
      This method returns the header values for the requested name.
      Specified by:
      getHeaderValues in interface IRestMessage
      Parameters:
      name - name of the header
      Returns:
      The header values, may be null.
    • setHeaders

      public void setHeaders(MultiValueMap headers)
    • getAcceptType

      public String getAcceptType()
    • setAcceptType

      public void setAcceptType(String mimeType)
    • getContentType

      public String getContentType()
      Description copied from interface: IRestMessage
      Returns the mime type of the message, or null if not specified.
      Specified by:
      getContentType in interface IRestMessage
      Returns:
      The mime type, or null.
    • setContentType

      public void setContentType(String mimeType)
    • getSingleHeaderValue

      protected String getSingleHeaderValue(String header)
    • toString

      public String toString()
      Overrides:
      toString in class Object