Interface ConverterResponseBuilder


  • @ProviderType
    public interface ConverterResponseBuilder
    A builder for creating ConverterResponse objects.
    • Method Detail

      • withHeader

        @Nonnull
        ConverterResponseBuilder withHeader​(java.lang.String key,
                                            java.lang.String value)
        Add a specific header with a single value to the response.
        Parameters:
        key - The header's key.
        value - The header's value.
        Returns:
        This ConverterResponseBuilder object.
      • withHeader

        @Nonnull
        ConverterResponseBuilder withHeader​(java.lang.String key,
                                            java.lang.String[] values)
        Add a specific header with multiple values to the response.
        Parameters:
        key - The header's key.
        values - The header's values.
        Returns:
        This ConverterResponseBuilder object
      • setBody

        @Nonnull
        ConverterResponseBuilder setBody​(java.lang.Object body)
        Set the body of the response. The body should be an instance of CharSequence or a byte[].
        Parameters:
        body - The body.
        Returns:
        This ConverterResponseBuilder object.
      • setContentType

        @Nonnull
        ConverterResponseBuilder setContentType​(java.lang.String contentType)
        Set the content type of the response.
        Parameters:
        contentType - The content type.
        Returns:
        This ConverterResponseBuilder object.
      • build

        @Nonnull
        ConverterResponse build()
        Build a ConverterResponse object with the values set in this builder.
        Returns:
        A ConverterResponse.