Class SpringMvcResponseBuilder

  • All Implemented Interfaces:
    ResponseBuilder<org.springframework.http.ResponseEntity<?>>

    @NotThreadSafe
    public class SpringMvcResponseBuilder
    extends ResponseBuilderSupport<org.springframework.http.ResponseEntity<?>>
    Author:
    Fabrizio Giudici
    • Constructor Detail

      • SpringMvcResponseBuilder

        public SpringMvcResponseBuilder()
    • Method Detail

      • withHeader

        @Nonnull
        public ResponseBuilder withHeader​(@Nonnull
                                          java.lang.String header,
                                          @Nonnull
                                          java.lang.String value)
        Description copied from class: ResponseBuilderSupport
        Sets a header.
        Specified by:
        withHeader in interface ResponseBuilder<org.springframework.http.ResponseEntity<?>>
        Specified by:
        withHeader in class ResponseBuilderSupport<org.springframework.http.ResponseEntity<?>>
        Parameters:
        header - the header name
        value - the header value
        Returns:
        itself for fluent interface style
      • getHeader

        @Nonnull
        protected java.util.Optional<java.lang.String> getHeader​(@Nonnull
                                                                 java.lang.String header)
        Description copied from class: ResponseBuilderSupport
        Returns a header response previously added.
        Specified by:
        getHeader in class ResponseBuilderSupport<org.springframework.http.ResponseEntity<?>>
        Parameters:
        header - the header name
        Returns:
        the header value
      • doBuild

        @Nonnull
        protected org.springframework.http.ResponseEntity<?> doBuild()
        Description copied from class: ResponseBuilderSupport
        This method actually builds the response and must be provided by concrete subclasses.
        Specified by:
        doBuild in class ResponseBuilderSupport<org.springframework.http.ResponseEntity<?>>
        Returns:
        the response