Record Class NettyHttpChannel
java.lang.Object
java.lang.Record
eu.cloudnetservice.driver.network.netty.http.NettyHttpChannel
- All Implemented Interfaces:
HttpChannel,AutoCloseable
public record NettyHttpChannel(@NonNull io.netty5.channel.Channel channel, @NonNull HostAndPort serverAddress, @NonNull HostAndPort clientAddress)
extends Record
implements HttpChannel
The default implementation of the http channel, delegating all method calls to netty.
- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final @NonNull io.netty5.channel.ChannelThe field for thechannelrecord component.private final @NonNull HostAndPortThe field for theclientAddressrecord component.private final @NonNull HostAndPortThe field for theserverAddressrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionNettyHttpChannel(@NonNull io.netty5.channel.Channel channel, @NonNull HostAndPort serverAddress, @NonNull HostAndPort clientAddress) Creates an instance of aNettyHttpChannelrecord class. -
Method Summary
Modifier and TypeMethodDescription@NonNull io.netty5.channel.Channelchannel()Returns the value of thechannelrecord component.Returns the value of theclientAddressrecord component.voidclose()Closes the underlying connection of the client to the server.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theserverAddressrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
channel
The field for thechannelrecord component. -
serverAddress
The field for theserverAddressrecord component. -
clientAddress
The field for theclientAddressrecord component.
-
-
Constructor Details
-
NettyHttpChannel
public NettyHttpChannel(@NonNull @NonNull io.netty5.channel.Channel channel, @NonNull @NonNull HostAndPort serverAddress, @NonNull @NonNull HostAndPort clientAddress) Creates an instance of aNettyHttpChannelrecord class.- Parameters:
channel- the value for thechannelrecord componentserverAddress- the value for theserverAddressrecord componentclientAddress- the value for theclientAddressrecord component
-
-
Method Details
-
close
public void close()Description copied from interface:HttpChannelCloses the underlying connection of the client to the server. After the close this channel cannot be used anymore.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceHttpChannel
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
channel
Returns the value of thechannelrecord component.- Returns:
- the value of the
channelrecord component
-
serverAddress
Returns the value of theserverAddressrecord component.- Specified by:
serverAddressin interfaceHttpChannel- Returns:
- the value of the
serverAddressrecord component
-
clientAddress
Returns the value of theclientAddressrecord component.- Specified by:
clientAddressin interfaceHttpChannel- Returns:
- the value of the
clientAddressrecord component
-