Interface RestResponseBuilder


  • public interface RestResponseBuilder
    Represent a REST response being constructed.
    • Method Detail

      • setStatus

        RestResponseBuilder setStatus​(int status)
        Set the response status
        Parameters:
        status - the status
        Returns:
        this rest response builder
      • setStatus

        RestResponseBuilder setStatus​(int status,
                                      java.lang.String reason)
        Set the response status and reason
        Parameters:
        status - the status
        reason - the reason
        Returns:
        this rest response builder
      • setContent

        RestResponseBuilder setContent​(java.lang.String contentType,
                                       java.lang.Object content,
                                       byte[] encodedContent)
        Set the content of the rest response.
        Parameters:
        contentType - the content type to be used
        content - the object that represents the content. This is used in tracing.
        encodedContent - the content, encoded as a byte[], according to the contentType
        Returns:
        this rest response builder
      • setHeader

        RestResponseBuilder setHeader​(java.lang.String name,
                                      java.lang.String value)
        Set a header in the response.
        Parameters:
        name - the header name
        value - the header value, may not be null
        Returns:
        this rest response builder
      • getApi

        java.lang.String getApi()
        Returns:
        the associated API for this rest response
      • getOperationId

        java.lang.String getOperationId()
        Returns:
        the associated operation-id for this rest response