Annotation Type GcMapped
Marks a Java class or record as mappable to a WebAssembly GC struct type.
Fields are mapped in declaration order to GC struct fields. Supported field types are:
int/Integer→ i32long/Long→ i64float/Float→ f32double/Double→ f64boolean/Boolean→ i32 (0/1)- Another
@GcMappedtype → struct reference
Example:
@GcMapped
public record Point(double x, double y) {}
GcMarshaller marshaller = GcMarshaller.forExtension(gc);
GcStructInstance struct = marshaller.marshal(new Point(1.0, 2.0));
Point point = marshaller.unmarshal(struct, Point.class);
-
Optional Element Summary
Optional Elements
-
Element Details
-
value
String valueOptional WasmGC struct type name. If empty, the simple class name is used.- Default:
""
-