1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
7 import java.lang.ref.Reference;
8 import javax.annotation.Nullable;
14 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
15 public class TwoTuple_OutPointCVec_MonitorUpdateIdZZ extends CommonBase {
16 TwoTuple_OutPointCVec_MonitorUpdateIdZZ(Object _dummy, long ptr) { super(ptr); }
17 @Override @SuppressWarnings("deprecation")
18 protected void finalize() throws Throwable {
20 if (ptr != 0) { bindings.C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(ptr); }
26 public OutPoint get_a() {
27 long ret = bindings.C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(this.ptr);
28 Reference.reachabilityFence(this);
29 if (ret >= 0 && ret <= 4096) { return null; }
30 org.ldk.structs.OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutPoint(null, ret); }
31 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
38 public MonitorUpdateId[] get_b() {
39 long[] ret = bindings.C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(this.ptr);
40 Reference.reachabilityFence(this);
41 int ret_conv_17_len = ret.length;
42 MonitorUpdateId[] ret_conv_17_arr = new MonitorUpdateId[ret_conv_17_len];
43 for (int r = 0; r < ret_conv_17_len; r++) {
44 long ret_conv_17 = ret[r];
45 org.ldk.structs.MonitorUpdateId ret_conv_17_hu_conv = null; if (ret_conv_17 < 0 || ret_conv_17 > 4096) { ret_conv_17_hu_conv = new org.ldk.structs.MonitorUpdateId(null, ret_conv_17); }
46 if (ret_conv_17_hu_conv != null) { ret_conv_17_hu_conv.ptrs_to.add(this); };
47 ret_conv_17_arr[r] = ret_conv_17_hu_conv;
49 return ret_conv_17_arr;
53 long ret = bindings.C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(this.ptr);
54 Reference.reachabilityFence(this);
59 * Creates a new tuple which has the same data as `orig`
60 * but with all dynamically-allocated buffers duplicated in new buffers.
62 public TwoTuple_OutPointCVec_MonitorUpdateIdZZ clone() {
63 long ret = bindings.C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(this.ptr);
64 Reference.reachabilityFence(this);
65 if (ret >= 0 && ret <= 4096) { return null; }
66 TwoTuple_OutPointCVec_MonitorUpdateIdZZ ret_hu_conv = new TwoTuple_OutPointCVec_MonitorUpdateIdZZ(null, ret);
67 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
72 * Creates a new C2Tuple_OutPointCVec_MonitorUpdateIdZZ from the contained elements.
74 public static TwoTuple_OutPointCVec_MonitorUpdateIdZZ of(org.ldk.structs.OutPoint a, MonitorUpdateId[] b) {
75 long ret = bindings.C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(a == null ? 0 : a.ptr, b != null ? Arrays.stream(b).mapToLong(b_conv_17 -> b_conv_17 == null ? 0 : b_conv_17.ptr).toArray() : null);
76 Reference.reachabilityFence(a);
77 Reference.reachabilityFence(b);
78 if (ret >= 0 && ret <= 4096) { return null; }
79 TwoTuple_OutPointCVec_MonitorUpdateIdZZ ret_hu_conv = new TwoTuple_OutPointCVec_MonitorUpdateIdZZ(null, ret);
80 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
81 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); };
82 for (MonitorUpdateId b_conv_17: b) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_conv_17); }; };