Module io.netty5.buffer
Package io.netty5.buffer.api.internal
Class SingleComponentIterator<T extends ComponentIterator.Next>
- java.lang.Object
-
- io.netty5.buffer.api.internal.SingleComponentIterator<T>
-
- All Implemented Interfaces:
ComponentIterator<T>
,SafeCloseable
,AutoCloseable
public final class SingleComponentIterator<T extends ComponentIterator.Next> extends Object implements ComponentIterator<T>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.netty5.buffer.api.ComponentIterator
ComponentIterator.Next
-
-
Constructor Summary
Constructors Constructor Description SingleComponentIterator(Resource<?> lifecycle, Object singleComponent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
T
first()
Get the first component of the iteration, ornull
if there are no components.
-
-
-
Method Detail
-
first
public T first()
Description copied from interface:ComponentIterator
Get the first component of the iteration, ornull
if there are no components.The object returned will implement both
ComponentIterator.Next
, and one of theReadableComponent
orWritableComponent
interfaces.- Specified by:
first
in interfaceComponentIterator<T extends ComponentIterator.Next>
- Returns:
- The first component of the iteration, or
null
if there are no components.
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceSafeCloseable
-
-