Package io.github.eutro.wasm2j.core.ext
Class DelegatingExtHolder
java.lang.Object
io.github.eutro.wasm2j.core.ext.ExtHolder
io.github.eutro.wasm2j.core.ext.DelegatingExtHolder
- All Implemented Interfaces:
ExtContainer
- Direct Known Subclasses:
DelegatingExporter,Effect,Insn,Op
An
ExtHolder that additionally delegates to another
ExtContainer if it can't find a given ext in itself.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ExtContainerGet theExtHolderto delegate to.<T> TgetNullable(Ext<T> ext) Get the value associated withextin this container, or null if not present.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.eutro.wasm2j.core.ext.ExtContainer
getExt, getExtOrRun, getExtOrThrow
-
Constructor Details
-
DelegatingExtHolder
public DelegatingExtHolder()
-
-
Method Details
-
getDelegate
Get theExtHolderto delegate to.- Returns:
- The delegate.
-
getNullable
Description copied from interface:ExtContainerGet the value associated withextin this container, or null if not present.If an ext was attached with
ExtContainer.attachExt(Ext, Object), it should be returned, unless it was later removed with a call toExtContainer.removeExt(Ext).- Specified by:
getNullablein interfaceExtContainer- Overrides:
getNullablein classExtHolder- Type Parameters:
T- The type of the ext.- Parameters:
ext- The ext.- Returns:
- The value associated with ext in this container.
-