2 import CommonBase from './CommonBase';
3 import * as bindings from '../bindings' // TODO: figure out location
5 public class Result_StringErrorZ extends CommonBase {
6 private Result_StringErrorZ(Object _dummy, long ptr) { super(ptr); }
7 protected void finalize() throws Throwable {
8 if (ptr != 0) { bindings.CResult_StringErrorZ_free(ptr); } super.finalize();
11 static Result_StringErrorZ constr_from_ptr(long ptr) {
12 if (bindings.LDKCResult_StringErrorZ_result_ok(ptr)) {
13 return new Result_StringErrorZ_OK(null, ptr);
15 return new Result_StringErrorZ_Err(null, ptr);
18 public static final class Result_StringErrorZ_OK extends Result_StringErrorZ {
19 public final String res;
20 private Result_StringErrorZ_OK(Object _dummy, long ptr) {
22 this.res = bindings.LDKCResult_StringErrorZ_get_ok(ptr);
26 public static final class Result_StringErrorZ_Err extends Result_StringErrorZ {
27 public final Secp256k1Error err;
28 private Result_StringErrorZ_Err(Object _dummy, long ptr) {
30 this.err = bindings.LDKCResult_StringErrorZ_get_err(ptr);
34 public static Result_StringErrorZ constructor_ok(String o) {
35 number ret = bindings.CResult_StringErrorZ_ok(o);
36 Result_StringErrorZ ret_hu_conv = Result_StringErrorZ.constr_from_ptr(ret);
40 public static Result_StringErrorZ constructor_err(Secp256k1Error e) {
41 number ret = bindings.CResult_StringErrorZ_err(e);
42 Result_StringErrorZ ret_hu_conv = Result_StringErrorZ.constr_from_ptr(ret);