Module io.netty5.common
Package io.netty5.util.internal
Class SendFromSupplier<T extends Resource<T>>
- java.lang.Object
 - 
- io.netty5.util.internal.SendFromSupplier<T>
 
 
- 
- All Implemented Interfaces:
 SafeCloseable,Send<T>,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.
 
- 
close
public void close()
Description copied from interface:SendDiscard thisSendand the object it contains. This has no effect if the send-object has already been received.- Specified by:
 closein interfaceAutoCloseable- Specified by:
 closein interfaceSafeCloseable- Specified by:
 closein interfaceSend<T extends Resource<T>>
 
 - 
 
 -