Package io.netty5.buffer.api.internal
Class SendFromSupplier<T extends Resource<T>>
- java.lang.Object
-
- io.netty5.buffer.api.internal.SendFromSupplier<T>
-
- All Implemented Interfaces:
Send<T>,io.netty5.util.SafeCloseable,AutoCloseable
public class SendFromSupplier<T extends Resource<T>> extends Object implements Send<T>
-
-
Constructor Summary
Constructors Constructor Description SendFromSupplier(Class<T> concreteObjectType, Supplier<? extends T> supplier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Discard thisSendand the object it contains.Treceive()Receive theResourceinstance being sent, and bind its ownership to the calling thread.booleanreferentIsInstanceOf(Class<?> cls)Determine if the object received from thisSendis an instance of the given class.
-
-
-
Method Detail
-
receive
public T receive()
Description copied from interface:SendReceive theResourceinstance being sent, and bind its ownership to the calling thread. The invalidation of the sent resource in the sending thread happens-before the return of this method.This method can only be called once, and will throw otherwise.
-
referentIsInstanceOf
public boolean referentIsInstanceOf(Class<?> cls)
Description copied from interface:SendDetermine if the object received from thisSendis an instance of the given class.- Specified by:
referentIsInstanceOfin interfaceSend<T extends Resource<T>>- Parameters:
cls- The type to check.- Returns:
trueif the object received from thisSendcan be assigned fields or variables of the given type, otherwise false.
-
-