[Java] Update tests to latest upstream API
[ldk-java] / src / main / java / org / ldk / structs / TwoTuple_OutPointCVec_MonitorEventZZ.java
1 package org.ldk.structs;
2
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
5 import org.ldk.util.*;
6 import java.util.Arrays;
7 import java.lang.ref.Reference;
8 import javax.annotation.Nullable;
9
10
11 /**
12  * A Tuple
13  */
14 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
15 public class TwoTuple_OutPointCVec_MonitorEventZZ extends CommonBase {
16         TwoTuple_OutPointCVec_MonitorEventZZ(Object _dummy, long ptr) { super(ptr); }
17         @Override @SuppressWarnings("deprecation")
18         protected void finalize() throws Throwable {
19                 super.finalize();
20                 if (ptr != 0) { bindings.C2Tuple_OutPointCVec_MonitorEventZZ_free(ptr); }
21         }
22
23         /**
24          * 
25          */
26         public OutPoint get_a() {
27                 long ret = bindings.C2Tuple_OutPointCVec_MonitorEventZZ_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                 ret_hu_conv.ptrs_to.add(this);
32                 return ret_hu_conv;
33         }
34
35         /**
36          * 
37          */
38         public MonitorEvent[] get_b() {
39                 long[] ret = bindings.C2Tuple_OutPointCVec_MonitorEventZZ_get_b(this.ptr);
40                 Reference.reachabilityFence(this);
41                 int ret_conv_14_len = ret.length;
42                 MonitorEvent[] ret_conv_14_arr = new MonitorEvent[ret_conv_14_len];
43                 for (int o = 0; o < ret_conv_14_len; o++) {
44                         long ret_conv_14 = ret[o];
45                         org.ldk.structs.MonitorEvent ret_conv_14_hu_conv = org.ldk.structs.MonitorEvent.constr_from_ptr(ret_conv_14);
46                         ret_conv_14_hu_conv.ptrs_to.add(this);
47                         ret_conv_14_arr[o] = ret_conv_14_hu_conv;
48                 }
49                 return ret_conv_14_arr;
50         }
51
52         long clone_ptr() {
53                 long ret = bindings.C2Tuple_OutPointCVec_MonitorEventZZ_clone_ptr(this.ptr);
54                 Reference.reachabilityFence(this);
55                 return ret;
56         }
57
58         /**
59          * Creates a new tuple which has the same data as `orig`
60          * but with all dynamically-allocated buffers duplicated in new buffers.
61          */
62         public TwoTuple_OutPointCVec_MonitorEventZZ clone() {
63                 long ret = bindings.C2Tuple_OutPointCVec_MonitorEventZZ_clone(this.ptr);
64                 Reference.reachabilityFence(this);
65                 if (ret >= 0 && ret <= 4096) { return null; }
66                 TwoTuple_OutPointCVec_MonitorEventZZ ret_hu_conv = new TwoTuple_OutPointCVec_MonitorEventZZ(null, ret);
67                 ret_hu_conv.ptrs_to.add(this);
68                 return ret_hu_conv;
69         }
70
71         /**
72          * Creates a new C2Tuple_OutPointCVec_MonitorEventZZ from the contained elements.
73          */
74         public static TwoTuple_OutPointCVec_MonitorEventZZ of(OutPoint a, MonitorEvent[] b) {
75                 long ret = bindings.C2Tuple_OutPointCVec_MonitorEventZZ_new(a == null ? 0 : a.ptr & ~1, b != null ? Arrays.stream(b).mapToLong(b_conv_14 -> b_conv_14.ptr).toArray() : null);
76                 Reference.reachabilityFence(a);
77                 Reference.reachabilityFence(b);
78                 if (ret >= 0 && ret <= 4096) { return null; }
79                 TwoTuple_OutPointCVec_MonitorEventZZ ret_hu_conv = new TwoTuple_OutPointCVec_MonitorEventZZ(null, ret);
80                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
81                 return ret_hu_conv;
82         }
83
84 }