Class PanamaGlobalType
java.lang.Object
ai.tegmentum.wasmtime4j.panama.type.PanamaGlobalType
- All Implemented Interfaces:
ai.tegmentum.wasmtime4j.type.GlobalType,ai.tegmentum.wasmtime4j.type.WasmType
public final class PanamaGlobalType
extends Object
implements ai.tegmentum.wasmtime4j.type.GlobalType
Panama implementation of GlobalType interface.
This class provides type introspection capabilities for WebAssembly global types using Panama Foreign Function Interface bindings to the native Wasmtime library.
- Since:
- 1.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionPanamaGlobalType(ai.tegmentum.wasmtime4j.WasmValueType valueType, boolean isMutable, Arena arena, MemorySegment nativeHandle) Creates a new PanamaGlobalType instance. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic PanamaGlobalTypefromNative(MemorySegment nativeHandle, Arena arena) Creates a PanamaGlobalType from native global type information.getArena()Gets the memory arena used by this global type.ai.tegmentum.wasmtime4j.type.WasmTypeKindgetKind()Gets the native handle for this global type.ai.tegmentum.wasmtime4j.WasmValueTypeinthashCode()booleanstatic PanamaGlobalTypeof(ai.tegmentum.wasmtime4j.WasmValueType valueType, boolean isMutable) Creates a PanamaGlobalType from type information without a native handle.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface ai.tegmentum.wasmtime4j.type.GlobalType
defaultValue, getContent, getMutability
-
Constructor Details
-
PanamaGlobalType
public PanamaGlobalType(ai.tegmentum.wasmtime4j.WasmValueType valueType, boolean isMutable, Arena arena, MemorySegment nativeHandle) Creates a new PanamaGlobalType instance.- Parameters:
valueType- the value type of the globalisMutable- true if the global is mutable, false if immutablearena- the memory arena for resource managementnativeHandle- the native handle to the global type
-
-
Method Details
-
of
public static PanamaGlobalType of(ai.tegmentum.wasmtime4j.WasmValueType valueType, boolean isMutable) Creates a PanamaGlobalType from type information without a native handle.This factory method is used when type information is parsed from JSON or other sources where a native handle is not available.
- Parameters:
valueType- the value type of the globalisMutable- true if the global is mutable, false if immutable- Returns:
- the PanamaGlobalType instance
-
fromNative
Creates a PanamaGlobalType from native global type information.- Parameters:
nativeHandle- the native handle to the global typearena- the memory arena for resource management- Returns:
- the PanamaGlobalType instance
- Throws:
IllegalArgumentException- if nativeHandle is invalid
-
getValueType
public ai.tegmentum.wasmtime4j.WasmValueType getValueType()- Specified by:
getValueTypein interfaceai.tegmentum.wasmtime4j.type.GlobalType
-
isMutable
public boolean isMutable()- Specified by:
isMutablein interfaceai.tegmentum.wasmtime4j.type.GlobalType
-
getKind
public ai.tegmentum.wasmtime4j.type.WasmTypeKind getKind()- Specified by:
getKindin interfaceai.tegmentum.wasmtime4j.type.GlobalType- Specified by:
getKindin interfaceai.tegmentum.wasmtime4j.type.WasmType
-
getNativeHandle
Gets the native handle for this global type.- Returns:
- the native handle
-
getArena
-
equals
-
hashCode
-
toString
-