d7df71fe024e6e33aab7b14fcd32107e1fd4dc01
[ldk-java] / src / main / java / org / ldk / structs / ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ.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 ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ extends CommonBase {
16         ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ(Object _dummy, long ptr) { super(ptr); }
17         @Override @SuppressWarnings("deprecation")
18         protected void finalize() throws Throwable {
19                 super.finalize();
20                 if (ptr != 0) { bindings.C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(ptr); }
21         }
22
23         /**
24          * 
25          */
26         public OutPoint get_a() {
27                 long ret = bindings.C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_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); };
32                 return ret_hu_conv;
33         }
34
35         /**
36          * 
37          */
38         public MonitorEvent[] get_b() {
39                 long[] ret = bindings.C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_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                         if (ret_conv_14_hu_conv != null) { 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         /**
53          * 
54          */
55         public byte[] get_c() {
56                 byte[] ret = bindings.C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(this.ptr);
57                 Reference.reachabilityFence(this);
58                 return ret;
59         }
60
61         long clone_ptr() {
62                 long ret = bindings.C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(this.ptr);
63                 Reference.reachabilityFence(this);
64                 return ret;
65         }
66
67         /**
68          * Creates a new tuple which has the same data as `orig`
69          * but with all dynamically-allocated buffers duplicated in new buffers.
70          */
71         public ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ clone() {
72                 long ret = bindings.C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(this.ptr);
73                 Reference.reachabilityFence(this);
74                 if (ret >= 0 && ret <= 4096) { return null; }
75                 ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ ret_hu_conv = new ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ(null, ret);
76                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
77                 return ret_hu_conv;
78         }
79
80         /**
81          * Creates a new C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ from the contained elements.
82          */
83         public static ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ of(org.ldk.structs.OutPoint a, MonitorEvent[] b, byte[] c) {
84                 long ret = bindings.C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(a == null ? 0 : a.ptr, b != null ? Arrays.stream(b).mapToLong(b_conv_14 -> b_conv_14.ptr).toArray() : null, InternalUtils.check_arr_len(c, 33));
85                 Reference.reachabilityFence(a);
86                 Reference.reachabilityFence(b);
87                 Reference.reachabilityFence(c);
88                 if (ret >= 0 && ret <= 4096) { return null; }
89                 ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ ret_hu_conv = new ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ(null, ret);
90                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
91                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); };
92                 return ret_hu_conv;
93         }
94
95 }