1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
8 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
9 public class Result_NoneAPIErrorZ extends CommonBase {
10 private Result_NoneAPIErrorZ(Object _dummy, long ptr) { super(ptr); }
11 protected void finalize() throws Throwable {
12 if (ptr != 0) { bindings.CResult_NoneAPIErrorZ_free(ptr); } super.finalize();
15 static Result_NoneAPIErrorZ constr_from_ptr(long ptr) {
16 if (bindings.LDKCResult_NoneAPIErrorZ_result_ok(ptr)) {
17 return new Result_NoneAPIErrorZ_OK(null, ptr);
19 return new Result_NoneAPIErrorZ_Err(null, ptr);
22 public static final class Result_NoneAPIErrorZ_OK extends Result_NoneAPIErrorZ {
23 public final byte res;
24 private Result_NoneAPIErrorZ_OK(Object _dummy, long ptr) {
26 this.res = bindings.LDKCResult_NoneAPIErrorZ_get_ok(ptr);
28 public Result_NoneAPIErrorZ_OK() {
29 this(null, bindings.CResult_NoneAPIErrorZ_ok());
33 public static final class Result_NoneAPIErrorZ_Err extends Result_NoneAPIErrorZ {
34 public final APIError err;
35 private Result_NoneAPIErrorZ_Err(Object _dummy, long ptr) {
37 long err = bindings.LDKCResult_NoneAPIErrorZ_get_err(ptr);
38 APIError err_hu_conv = APIError.constr_from_ptr(err);
39 err_hu_conv.ptrs_to.add(this);
40 this.err = err_hu_conv;
42 public Result_NoneAPIErrorZ_Err(APIError err) {
43 this(null, bindings.CResult_NoneAPIErrorZ_err(err.ptr));