java.lang.Object
io.helidon.http.DirectHandler.TransportResponse.Builder
- All Implemented Interfaces:
Builder<DirectHandler.TransportResponse.Builder,
,DirectHandler.TransportResponse> Supplier<DirectHandler.TransportResponse>
- Enclosing class:
DirectHandler.TransportResponse
public static class DirectHandler.TransportResponse.Builder
extends Object
implements Builder<DirectHandler.TransportResponse.Builder,DirectHandler.TransportResponse>
Fluent API builder for
DirectHandler.TransportResponse
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build the instance from this builder.entity
(byte[] entity) Custom entity.Custom entity.Set a header (if exists, it would be replaced).header
(HeaderName name, String... values) Set a header (if exists, it would be replaced).headers
(ServerResponseHeaders headers) Set headers.keepAlive
(boolean keepAlive) Configure keep alive.Custom status.
-
Method Details
-
build
Description copied from interface:Builder
Build the instance from this builder.- Specified by:
build
in interfaceBuilder<DirectHandler.TransportResponse.Builder,
DirectHandler.TransportResponse> - Returns:
- instance of the built type
-
status
Custom status.- Parameters:
status
- status to use, default is bad request- Returns:
- updated builder
-
headers
Set headers.- Parameters:
headers
- headers to use- Returns:
- updated builder
-
header
Set a header (if exists, it would be replaced). Keep alive header is ignored, please usekeepAlive(boolean)
.- Parameters:
name
- name of the headervalues
- value of the header- Returns:
- updated builder
-
header
Set a header (if exists, it would be replaced). Keep alive header is ignored, please usekeepAlive(boolean)
.- Parameters:
header
- header value- Returns:
- updated builder
-
keepAlive
Configure keep alive.- Parameters:
keepAlive
- whether to keep alive- Returns:
- updated builder
-
entity
Custom entity. Uses the content, reads it asUTF-8
, configuresContent-Length
header, configuresContent-Type
header totext/plain
.Use
entity(byte[])
for custom encoding.Note that this method does not do any escaping (such as HTML encoding), make sure the entity is safe.
- Parameters:
entity
- response entity- Returns:
- updated builder
-
entity
Custom entity. Uses the content, configuresContent-Length
header.Use
entity(String)
for simple text messages.- Parameters:
entity
- response entity- Returns:
- updated builder
-