Record Class NettyNioBufferReleasingAllocator.DirectBufferFreeDrop

java.lang.Object
java.lang.Record
eu.cloudnetservice.driver.network.netty.buffer.NettyNioBufferReleasingAllocator.DirectBufferFreeDrop
Record Components:
memoryManager - the memory manager that is responsible for allocation.
All Implemented Interfaces:
io.netty5.buffer.Drop<io.netty5.buffer.Buffer>
Enclosing class:
NettyNioBufferReleasingAllocator

private static record NettyNioBufferReleasingAllocator.DirectBufferFreeDrop(@NonNull io.netty5.buffer.bytebuffer.ByteBufferMemoryManager memoryManager) extends Record implements io.netty5.buffer.Drop<io.netty5.buffer.Buffer>
A drop implementation that ínvokes the cleaner of ByteBuffers directly upon dropping.
Since:
4.0
  • Field Details

    • memoryManager

      @NonNull private final @NonNull io.netty5.buffer.bytebuffer.ByteBufferMemoryManager memoryManager
      The field for the memoryManager record component.
    • DIRECT_BUFFER_CLEANER

      private static final MethodHandle DIRECT_BUFFER_CLEANER
    • LOGGER

      private static final org.slf4j.Logger LOGGER
  • Constructor Details

    • DirectBufferFreeDrop

      private DirectBufferFreeDrop(@NonNull @NonNull io.netty5.buffer.bytebuffer.ByteBufferMemoryManager memoryManager)
      Creates an instance of a DirectBufferFreeDrop record class.
      Parameters:
      memoryManager - the value for the memoryManager record component
  • Method Details

    • drop

      public void drop(@NonNull @NonNull io.netty5.buffer.Buffer obj)
      Specified by:
      drop in interface io.netty5.buffer.Drop<io.netty5.buffer.Buffer>
    • fork

      @NonNull public @NonNull io.netty5.buffer.Drop<io.netty5.buffer.Buffer> fork()
      Specified by:
      fork in interface io.netty5.buffer.Drop<io.netty5.buffer.Buffer>
    • attach

      public void attach(@NonNull @NonNull io.netty5.buffer.Buffer obj)
      Specified by:
      attach in interface io.netty5.buffer.Drop<io.netty5.buffer.Buffer>
    • 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.
    • memoryManager

      @NonNull public @NonNull io.netty5.buffer.bytebuffer.ByteBufferMemoryManager memoryManager()
      Returns the value of the memoryManager record component.
      Returns:
      the value of the memoryManager record component