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_QueryShortChannelIdsDecodeErrorZ extends CommonBase {
10 private Result_QueryShortChannelIdsDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
11 protected void finalize() throws Throwable {
12 if (ptr != 0) { bindings.CResult_QueryShortChannelIdsDecodeErrorZ_free(ptr); } super.finalize();
15 static Result_QueryShortChannelIdsDecodeErrorZ constr_from_ptr(long ptr) {
16 if (bindings.LDKCResult_QueryShortChannelIdsDecodeErrorZ_result_ok(ptr)) {
17 return new Result_QueryShortChannelIdsDecodeErrorZ_OK(null, ptr);
19 return new Result_QueryShortChannelIdsDecodeErrorZ_Err(null, ptr);
22 public static final class Result_QueryShortChannelIdsDecodeErrorZ_OK extends Result_QueryShortChannelIdsDecodeErrorZ {
23 public final QueryShortChannelIds res;
24 private Result_QueryShortChannelIdsDecodeErrorZ_OK(Object _dummy, long ptr) {
26 long res = bindings.LDKCResult_QueryShortChannelIdsDecodeErrorZ_get_ok(ptr);
27 QueryShortChannelIds res_hu_conv = new QueryShortChannelIds(null, res);
28 this.res = res_hu_conv;
30 public Result_QueryShortChannelIdsDecodeErrorZ_OK(QueryShortChannelIds res) {
31 this(null, bindings.CResult_QueryShortChannelIdsDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
32 this.ptrs_to.add(res);
36 public static final class Result_QueryShortChannelIdsDecodeErrorZ_Err extends Result_QueryShortChannelIdsDecodeErrorZ {
37 public final DecodeError err;
38 private Result_QueryShortChannelIdsDecodeErrorZ_Err(Object _dummy, long ptr) {
40 long err = bindings.LDKCResult_QueryShortChannelIdsDecodeErrorZ_get_err(ptr);
41 DecodeError err_hu_conv = new DecodeError(null, err);
42 this.err = err_hu_conv;
44 public Result_QueryShortChannelIdsDecodeErrorZ_Err(DecodeError err) {
45 this(null, bindings.CResult_QueryShortChannelIdsDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
46 this.ptrs_to.add(err);