Package org.takes.rs

Class RsFluent

  • All Implemented Interfaces:
    Body, Head, Response

    public final class RsFluent
    extends RsWrap
    Fluent response.

    The class is immutable and thread-safe.

    Since:
    0.1
    • Constructor Detail

      • RsFluent

        public RsFluent()
        Ctor.
      • RsFluent

        public RsFluent​(Response res)
        Ctor.
        Parameters:
        res - Original response
    • Method Detail

      • withStatus

        public RsFluent withStatus​(int code)
        With this status code.
        Parameters:
        code - Status code
        Returns:
        New fluent response
      • withHeader

        public RsFluent withHeader​(CharSequence header)
        With this header.
        Parameters:
        header - The header
        Returns:
        New fluent response
      • withHeader

        public RsFluent withHeader​(CharSequence key,
                                   CharSequence value)
        With this header.
        Parameters:
        key - Key
        value - Value
        Returns:
        New fluent response
      • withType

        public RsFluent withType​(CharSequence ctype)
        With this content type.
        Parameters:
        ctype - Content type
        Returns:
        New fluent response
      • withBody

        public RsFluent withBody​(CharSequence body)
        With this body.
        Parameters:
        body - Body
        Returns:
        New fluent response
      • withBody

        public RsFluent withBody​(byte[] body)
        With this body.
        Parameters:
        body - Body
        Returns:
        New fluent response
      • withBody

        public RsFluent withBody​(InputStream body)
        With this body.
        Parameters:
        body - Body
        Returns:
        New fluent response