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_UnsignedChannelAnnouncementDecodeErrorZ extends CommonBase {
10 private Result_UnsignedChannelAnnouncementDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
11 protected void finalize() throws Throwable {
12 if (ptr != 0) { bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(ptr); } super.finalize();
15 static Result_UnsignedChannelAnnouncementDecodeErrorZ constr_from_ptr(long ptr) {
16 if (bindings.LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_result_ok(ptr)) {
17 return new Result_UnsignedChannelAnnouncementDecodeErrorZ_OK(null, ptr);
19 return new Result_UnsignedChannelAnnouncementDecodeErrorZ_Err(null, ptr);
22 public static final class Result_UnsignedChannelAnnouncementDecodeErrorZ_OK extends Result_UnsignedChannelAnnouncementDecodeErrorZ {
23 public final UnsignedChannelAnnouncement res;
24 private Result_UnsignedChannelAnnouncementDecodeErrorZ_OK(Object _dummy, long ptr) {
26 long res = bindings.LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(ptr);
27 UnsignedChannelAnnouncement res_hu_conv = new UnsignedChannelAnnouncement(null, res);
28 res_hu_conv.ptrs_to.add(this);
29 this.res = res_hu_conv;
31 public Result_UnsignedChannelAnnouncementDecodeErrorZ_OK(UnsignedChannelAnnouncement res) {
32 this(null, bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
33 this.ptrs_to.add(res);
37 public static final class Result_UnsignedChannelAnnouncementDecodeErrorZ_Err extends Result_UnsignedChannelAnnouncementDecodeErrorZ {
38 public final DecodeError err;
39 private Result_UnsignedChannelAnnouncementDecodeErrorZ_Err(Object _dummy, long ptr) {
41 long err = bindings.LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(ptr);
42 DecodeError err_hu_conv = new DecodeError(null, err);
43 err_hu_conv.ptrs_to.add(this);
44 this.err = err_hu_conv;
46 public Result_UnsignedChannelAnnouncementDecodeErrorZ_Err(DecodeError err) {
47 this(null, bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
48 this.ptrs_to.add(err);