Module io.helidon.webserver
Package io.helidon.webserver
Class DirectHandler.TransportResponse.Builder
java.lang.Object
io.helidon.webserver.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.Add/replace a header.status
(Http.ResponseStatus status) 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
-
header
Add/replace a header.- Parameters:
name
- name of the headervalues
- value of the header- Returns:
- updated builder
- Throws:
IllegalArgumentException
- if an attempt is made to modify protected headers (such as Connection)
-
entity
Custom entity. Uses the content, encodes it for HTML, reads it asUTF-8
, configuresContent-Length
header, configuresContent-Type
header totext/plain
.Use
entity(byte[])
for custom encoding.- 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
-