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
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ExtContainer
Get theExtHolder
to delegate to.<T> T
getNullable
(Ext<T> ext) Get the value associated withext
in this container, or null if not present.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.github.eutro.wasm2j.core.ext.ExtContainer
getExt, getExtOrRun, getExtOrThrow
-
Constructor Details
-
DelegatingExtHolder
public DelegatingExtHolder()
-
-
Method Details
-
getDelegate
Get theExtHolder
to delegate to.- Returns:
- The delegate.
-
getNullable
Description copied from interface:ExtContainer
Get the value associated withext
in 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:
getNullable
in interfaceExtContainer
- Overrides:
getNullable
in classExtHolder
- Type Parameters:
T
- The type of the ext.- Parameters:
ext
- The ext.- Returns:
- The value associated with ext in this container.
-