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 Details

    • channel

      @NonNull private final @NonNull io.netty5.channel.Channel channel
      The field for the channel record component.
    • serverAddress

      @NonNull private final @NonNull HostAndPort serverAddress
      The field for the serverAddress record component.
    • clientAddress

      @NonNull private final @NonNull HostAndPort clientAddress
      The field for the clientAddress record 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 a NettyHttpChannel record class.
      Parameters:
      channel - the value for the channel record component
      serverAddress - the value for the serverAddress record component
      clientAddress - the value for the clientAddress record component
  • Method Details

    • close

      public void close()
      Description copied from interface: HttpChannel
      Closes the underlying connection of the client to the server. After the close this channel cannot be used anymore.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface HttpChannel
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • channel

      @NonNull public @NonNull io.netty5.channel.Channel channel()
      Returns the value of the channel record component.
      Returns:
      the value of the channel record component
    • serverAddress

      @NonNull public @NonNull HostAndPort serverAddress()
      Returns the value of the serverAddress record component.
      Specified by:
      serverAddress in interface HttpChannel
      Returns:
      the value of the serverAddress record component
    • clientAddress

      @NonNull public @NonNull HostAndPort clientAddress()
      Returns the value of the clientAddress record component.
      Specified by:
      clientAddress in interface HttpChannel
      Returns:
      the value of the clientAddress record component