Record Class DefaultPipelineContext

java.lang.Object
java.lang.Record
com.iohao.net.external.core.netty.micro.DefaultPipelineContext
All Implemented Interfaces:
PipelineContext

public record DefaultPipelineContext(io.netty.channel.Channel channel, ExternalSetting setting) extends Record implements PipelineContext
PipelineContext is mainly used to wrap the SocketChannel channel, aiming to enhance the Handler aware capability
Author:
渔民小镇
date:
2023-04-26
  • Constructor Details

    • DefaultPipelineContext

      public DefaultPipelineContext(io.netty.channel.Channel channel, ExternalSetting setting)
      Creates an instance of a DefaultPipelineContext record class.
      Parameters:
      channel - the value for the channel record component
      setting - the value for the setting record component
  • Method Details

    • addFirst

      public void addFirst(String name, Object handler)
      Description copied from interface: PipelineContext
      Adds the handler to the first position.
      Specified by:
      addFirst in interface PipelineContext
      Parameters:
      name - The name of the handler
      handler - The handler
    • addLast

      public void addLast(String name, Object handler)
      Description copied from interface: PipelineContext
      Adds the handler to the last position.
      Specified by:
      addLast in interface PipelineContext
      Parameters:
      name - The name of the handler
      handler - The handler
    • remove

      public void remove(String name)
      Description copied from interface: PipelineContext
      Removes the specified handler.
      Specified by:
      remove in interface PipelineContext
      Parameters:
      name - The name of the handler
    • 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

      public io.netty.channel.Channel channel()
      Returns the value of the channel record component.
      Returns:
      the value of the channel record component
    • setting

      public ExternalSetting setting()
      Returns the value of the setting record component.
      Returns:
      the value of the setting record component