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_NoneMonitorUpdateErrorZ extends CommonBase {
10 private Result_NoneMonitorUpdateErrorZ(Object _dummy, long ptr) { super(ptr); }
11 protected void finalize() throws Throwable {
12 if (ptr != 0) { bindings.CResult_NoneMonitorUpdateErrorZ_free(ptr); } super.finalize();
15 static Result_NoneMonitorUpdateErrorZ constr_from_ptr(long ptr) {
16 if (bindings.LDKCResult_NoneMonitorUpdateErrorZ_result_ok(ptr)) {
17 return new Result_NoneMonitorUpdateErrorZ_OK(null, ptr);
19 return new Result_NoneMonitorUpdateErrorZ_Err(null, ptr);
22 public static final class Result_NoneMonitorUpdateErrorZ_OK extends Result_NoneMonitorUpdateErrorZ {
23 public final byte res;
24 private Result_NoneMonitorUpdateErrorZ_OK(Object _dummy, long ptr) {
26 this.res = bindings.LDKCResult_NoneMonitorUpdateErrorZ_get_ok(ptr);
28 public Result_NoneMonitorUpdateErrorZ_OK() {
29 this(null, bindings.CResult_NoneMonitorUpdateErrorZ_ok());
33 public static final class Result_NoneMonitorUpdateErrorZ_Err extends Result_NoneMonitorUpdateErrorZ {
34 public final MonitorUpdateError err;
35 private Result_NoneMonitorUpdateErrorZ_Err(Object _dummy, long ptr) {
37 long err = bindings.LDKCResult_NoneMonitorUpdateErrorZ_get_err(ptr);
38 MonitorUpdateError err_hu_conv = new MonitorUpdateError(null, err);
39 this.err = err_hu_conv;
41 public Result_NoneMonitorUpdateErrorZ_Err(MonitorUpdateError err) {
42 this(null, bindings.CResult_NoneMonitorUpdateErrorZ_err(err == null ? 0 : err.ptr & ~1));
43 this.ptrs_to.add(err);