java.lang.Object
io.helidon.http.DirectHandler.TransportResponse.Builder
- All Implemented Interfaces:
io.helidon.common.Builder<DirectHandler.TransportResponse.Builder,,DirectHandler.TransportResponse> Supplier<DirectHandler.TransportResponse>
- Enclosing class:
DirectHandler.TransportResponse
public static class DirectHandler.TransportResponse.Builder
extends Object
implements io.helidon.common.Builder<DirectHandler.TransportResponse.Builder,DirectHandler.TransportResponse>
Fluent API builder for
DirectHandler.TransportResponse.-
Method Summary
Modifier and TypeMethodDescriptionbuild()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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.helidon.common.Builder
get, identity, update
-
Method Details
-
build
- Specified by:
buildin interfaceio.helidon.common.Builder<DirectHandler.TransportResponse.Builder,DirectHandler.TransportResponse>
-
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-Lengthheader, configuresContent-Typeheader 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-Lengthheader.Use
entity(String)for simple text messages.- Parameters:
entity- response entity- Returns:
- updated builder
-