Top Description Inners Fields Constructors Methods
io.netty5.handler.codec.http

public Class DefaultLastHttpContent

extends DefaultHttpObject
implements LastHttpContent<DefaultLastHttpContent>
Class Inheritance
All Implemented Interfaces
io.netty5.handler.codec.http.LastHttpContent, io.netty5.handler.codec.http.HttpContent, io.netty5.util.Resource, java.lang.AutoCloseable, io.netty5.handler.codec.http.HttpObject, io.netty5.handler.codec.DecoderResultProvider
Imports
io.netty5.buffer.Buffer, io.netty5.handler.codec.http.headers.DefaultHttpHeaders, .HttpHeaders, io.netty5.util.Send, io.netty5.util.internal.StringUtil, org.jetbrains.annotations.Nullable, java.util.Map.Entry

The default LastHttpContent implementation.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final Buffer
private final HttpHeaders

Constructor Summary

AccessConstructor and Description
public
public
DefaultLastHttpContent(Buffer payload, boolean validateHeaders)

public
DefaultLastHttpContent(Buffer payload, HttpHeaders trailingHeaders)

Method Summary

Modifier and TypeMethod and Description
private void
public void
close()

Implements io.netty5.util.Resource.close.

Close the resource, making it inaccessible.
public DefaultLastHttpContent
copy()

Implements io.netty5.handler.codec.http.HttpContent.copy.

Create a copy of this HTTP content instance, and return it.
public boolean
isAccessible()

Implements io.netty5.util.Resource.isAccessible.

Check if this object is accessible.
public Buffer
payload()

Implements io.netty5.handler.codec.http.HttpContent.payload.

Returns the Buffer representing the payload of the HTTP message.
public Send<DefaultLastHttpContent>
send()

Implements io.netty5.util.Resource.send.

Send this object instance to another Thread, transferring the ownership to the recipient.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public DefaultLastHttpContent
touch(Object
An optional hint about this access and its context. May be null.
hint
)

Overrides default io.netty5.util.Resource.touch.

Record the current access location for debugging purposes.
public HttpHeaders
Inherited from io.netty5.handler.codec.http.DefaultHttpObject:
decoderResultequalshashCodesetDecoderResult

Field Detail

payloadback to summary
private final Buffer payload
trailingHeadersback to summary
private final HttpHeaders trailingHeaders

Constructor Detail

DefaultLastHttpContentback to summary
public DefaultLastHttpContent(Buffer payload)
DefaultLastHttpContentback to summary
public DefaultLastHttpContent(Buffer payload, boolean validateHeaders)
DefaultLastHttpContentback to summary
public DefaultLastHttpContent(Buffer payload, HttpHeaders trailingHeaders)

Method Detail

appendHeadersback to summary
private void appendHeaders(StringBuilder buf)
closeback to summary
public void close()

Implements io.netty5.util.Resource.close.

Doc from io.netty5.util.Resource.close.

Close the resource, making it inaccessible.

Note, this method is not thread-safe unless otherwise specified.

Annotations
@Override
copyback to summary
public DefaultLastHttpContent copy()

Implements io.netty5.handler.codec.http.HttpContent.copy.

Doc from io.netty5.handler.codec.http.HttpContent.copy.

Create a copy of this HTTP content instance, and return it.

Returns:DefaultLastHttpContent

A copy of this HTTP content object.

Annotations
@Override
isAccessibleback to summary
public boolean isAccessible()

Implements io.netty5.util.Resource.isAccessible.

Doc from io.netty5.util.Resource.isAccessible.

Check if this object is accessible.

Returns:boolean

true if this object is still valid and can be accessed, otherwise false if, for instance, this object has been dropped/deallocated, or been sent elsewhere.

Annotations
@Override
payloadback to summary
public Buffer payload()

Implements io.netty5.handler.codec.http.HttpContent.payload.

Doc from io.netty5.handler.codec.http.HttpContent.payload.

Returns the Buffer representing the payload of the HTTP message.

Returns:Buffer

The Buffer representing the payload of the HTTP message.

Annotations
@Override
sendback to summary
public Send<DefaultLastHttpContent> send()

Implements io.netty5.util.Resource.send.

Doc from io.netty5.util.Resource.send.

Send this object instance to another Thread, transferring the ownership to the recipient.

The object must be in a state where it can be sent, which includes at least being accessible.

When sent, this instance will immediately become inaccessible, as if by closing it. All attempts at accessing an object that has been sent, even if that object has not yet been received, should cause an exception to be thrown.

Calling close() on an object that has been sent will have no effect, so this method is safe to call within a try-with-resources statement.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override
touchback to summary
public DefaultLastHttpContent touch(Object hint)

Overrides default io.netty5.util.Resource.touch.

Doc from io.netty5.util.Resource.touch.

Record the current access location for debugging purposes. This information may be included if the resource throws a life-cycle related exception, or if it leaks. If this resource has already been closed, then this method has no effect.

Parameters
hint:Object

An optional hint about this access and its context. May be null.

Returns:DefaultLastHttpContent

This resource instance.

Annotations
@Override
trailingHeadersback to summary
public HttpHeaders trailingHeaders()

Implements io.netty5.handler.codec.http.LastHttpContent.trailingHeaders.

Annotations
@Override
io.netty5.handler.codec.http back to summary

private final Class DefaultLastHttpContent.TrailingHttpHeaders

extends DefaultHttpHeaders
Class Inheritance

Field Summary

Inherited from io.netty5.handler.codec.http.headers.DefaultHttpHeaders:
validateCookiesvalidateNamesvalidateValues

Constructor Summary

AccessConstructor and Description
pack-priv
TrailingHttpHeaders(boolean validate)

Method Summary

Modifier and TypeMethod and Description
protected CharSequence
validateKey(@Nullable CharSequence
The key which will be inserted.
name
,
boolean
true if this validation is for adding to the headers, or false if this is for setting (overwriting) the given header.
forAdd
)

Implements abstract io.netty5.handler.codec.http.headers.MultiMap.validateKey.

Validate the key before inserting it into this MultiMap.
Inherited from io.netty5.handler.codec.http.headers.DefaultHttpHeaders:
addaddaddaddaddCookieaddSetCookieclearcontainscontainsIgnoreCasecopyequalsequalsForValuegetgetAndRemovegetCookiegetCookiesIteratorgetCookiesIteratorgetSetCookiegetSetCookiesIteratorgetSetCookiesIteratorgetSetCookiesIteratorhashCodehashCodeForValueisKeyEqualityCompatibleiteratornamesremoveremoveremoveCookiesremoveIgnoreCaseremoveSetCookiesremoveSetCookiessetsetsettoStringvalidateHeaderNamevalidateKeyvalidateValuevaluesIterator

Constructor Detail

TrailingHttpHeadersback to summary
pack-priv TrailingHttpHeaders(boolean validate)

Method Detail

validateKeyback to summary
protected CharSequence validateKey(@Nullable CharSequence name, boolean forAdd)

Implements abstract io.netty5.handler.codec.http.headers.MultiMap.validateKey.

Doc from io.netty5.handler.codec.http.headers.MultiMap.validateKey.

Validate the key before inserting it into this MultiMap.

Parameters
name:@Nullable CharSequence

The key which will be inserted.

forAdd:boolean

true if this validation is for adding to the headers, or false if this is for setting (overwriting) the given header.

Annotations
@Override