[Java] Update auto-generated bindings to 0.0.117
[ldk-java] / src / main / java / org / ldk / structs / Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ.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  * An enum which can either contain a crate::c_types::derived::C2Tuple__u1632_u1632Z or not
13  */
14 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
15 public class Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ extends CommonBase {
16         private Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ(Object _dummy, long ptr) { super(ptr); }
17         @Override @SuppressWarnings("deprecation")
18         protected void finalize() throws Throwable {
19                 super.finalize();
20                 if (ptr != 0) { bindings.COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_free(ptr); }
21         }
22         static Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ constr_from_ptr(long ptr) {
23                 bindings.LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ raw_val = bindings.LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_ref_from_ptr(ptr);
24                 if (raw_val.getClass() == bindings.LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ.Some.class) {
25                         return new Some(ptr, (bindings.LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ.Some)raw_val);
26                 }
27                 if (raw_val.getClass() == bindings.LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ.None.class) {
28                         return new None(ptr, (bindings.LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ.None)raw_val);
29                 }
30                 assert false; return null; // Unreachable without extending the (internal) bindings interface
31         }
32
33         /**
34          * When we're in this state, this COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ contains a crate::c_types::derived::C2Tuple__u1632_u1632Z
35          */
36         public final static class Some extends Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ {
37                 public final org.ldk.structs.TwoTuple__u1632_u1632Z some;
38                 private Some(long ptr, bindings.LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ.Some obj) {
39                         super(null, ptr);
40                         long some = obj.some;
41                         TwoTuple__u1632_u1632Z some_hu_conv = new TwoTuple__u1632_u1632Z(null, some);
42                         if (some_hu_conv != null) { some_hu_conv.ptrs_to.add(this); };
43                         this.some = some_hu_conv;
44                 }
45         }
46         /**
47          * When we're in this state, this COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ contains nothing
48          */
49         public final static class None extends Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ {
50                 private None(long ptr, bindings.LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ.None obj) {
51                         super(null, ptr);
52                 }
53         }
54         /**
55          * Constructs a new COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ containing a crate::c_types::derived::C2Tuple__u1632_u1632Z
56          */
57         public static Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ some(org.ldk.structs.TwoTuple__u1632_u1632Z o) {
58                 long ret = bindings.COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_some(o != null ? o.ptr : 0);
59                 Reference.reachabilityFence(o);
60                 if (ret >= 0 && ret <= 4096) { return null; }
61                 org.ldk.structs.Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ.constr_from_ptr(ret);
62                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
63                 return ret_hu_conv;
64         }
65
66         /**
67          * Constructs a new COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ containing nothing
68          */
69         public static Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ none() {
70                 long ret = bindings.COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_none();
71                 if (ret >= 0 && ret <= 4096) { return null; }
72                 org.ldk.structs.Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ.constr_from_ptr(ret);
73                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
74                 return ret_hu_conv;
75         }
76
77 }