接口 RenderingResponse.Builder

所有已知实现类:
DefaultRenderingResponseBuilder
封闭接口:
RenderingResponse

public static interface RenderingResponse.Builder
Defines a builder for RenderingResponse.
  • 方法详细资料

    • modelAttribute

      RenderingResponse.Builder modelAttribute(Object attribute)
      Add the supplied attribute to the model using a generated name.

      Note: Empty Collections are not added to the model when using this method because we cannot correctly determine the true convention name. View code should check for null rather than for empty collections.

      参数:
      attribute - the model attribute value (never null)
    • modelAttribute

      RenderingResponse.Builder modelAttribute(String name, @Nullable Object value)
      Add the supplied attribute value under the supplied name.
      参数:
      name - the name of the model attribute (never null)
      value - the model attribute value (can be null)
    • modelAttributes

      RenderingResponse.Builder modelAttributes(Object... attributes)
      Copy all attributes in the supplied array into the model, using attribute name generation for each element.
      另请参阅:
    • modelAttributes

      RenderingResponse.Builder modelAttributes(Collection<?> attributes)
      Copy all attributes in the supplied Collection into the model, using attribute name generation for each element.
      另请参阅:
    • modelAttributes

      RenderingResponse.Builder modelAttributes(Map<String,?> attributes)
      Copy all attributes in the supplied Map into the model.
      另请参阅:
    • header

      RenderingResponse.Builder header(String headerName, String... headerValues)
      Add the given header value(s) under the given name.
      参数:
      headerName - the header name
      headerValues - the header value(s)
      返回:
      this builder
      另请参阅:
    • headers

      RenderingResponse.Builder headers(Consumer<HttpHeaders> headersConsumer)
      Manipulate this response's headers with the given consumer. The headers provided to the consumer are "live", so that the consumer can be used to overwrite existing header values, remove values, or use any of the other HttpHeaders methods.
      参数:
      headersConsumer - a function that consumes the HttpHeaders
      返回:
      this builder
    • status

      Set the HTTP status.
      参数:
      status - the response status
      返回:
      this builder
    • status

      RenderingResponse.Builder status(int status)
      Set the HTTP status.
      参数:
      status - the response status
      返回:
      this builder
    • cookie

      Add the given cookie to the response.
      参数:
      cookie - the cookie to add
      返回:
      this builder
    • cookies

      RenderingResponse.Builder cookies(Consumer<cn.taketoday.util.MultiValueMap<String,HttpCookie>> cookiesConsumer)
      Manipulate this response's cookies with the given consumer. The cookies provided to the consumer are "live", so that the consumer can be used to overwrite existing cookies, remove cookies, or use any of the other MultiValueMap methods.
      参数:
      cookiesConsumer - a function that consumes the cookies
      返回:
      this builder
    • build

      Build the response.
      返回:
      the built response