Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.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
8 public class Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ extends CommonBase {
9         private Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
10         protected void finalize() throws Throwable {
11                 if (ptr != 0) { bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(ptr); } super.finalize();
12         }
13
14         static Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ constr_from_ptr(long ptr) {
15                 if (bindings.LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_result_ok(ptr)) {
16                         return new Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_OK(null, ptr);
17                 } else {
18                         return new Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_Err(null, ptr);
19                 }
20         }
21         public static final class Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_OK extends Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
22                 public final TwoTuple<byte[], ChannelMonitor> res;
23                 private Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_OK(Object _dummy, long ptr) {
24                         super(_dummy, ptr);
25                         long res = bindings.LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(ptr);
26                         byte[] res_a = bindings.LDKC2Tuple_BlockHashChannelMonitorZ_get_a(res);
27                         long res_b = bindings.LDKC2Tuple_BlockHashChannelMonitorZ_get_b(res);
28                         ChannelMonitor res_b_hu_conv = new ChannelMonitor(null, res_b);
29                         res_b_hu_conv.ptrs_to.add(this);;
30                         TwoTuple<byte[], ChannelMonitor> res_conv = new TwoTuple<byte[], ChannelMonitor>(res_a, res_b_hu_conv, () -> {
31                                 bindings.C2Tuple_BlockHashChannelMonitorZ_free(res);
32                         });
33                         res_b_hu_conv.ptrs_to.add(res_conv);
34                         this.res = res_conv;
35                 }
36         }
37
38         public static final class Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_Err extends Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
39                 public final DecodeError err;
40                 private Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_Err(Object _dummy, long ptr) {
41                         super(_dummy, ptr);
42                         long err = bindings.LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(ptr);
43                         DecodeError err_hu_conv = new DecodeError(null, err);
44                         err_hu_conv.ptrs_to.add(this);
45                         this.err = err_hu_conv;
46                 }
47         }
48
49         /**
50          * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the success state.
51          */
52         public static Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ constructor_ok(TwoTuple<byte[], ChannelMonitor> o) {
53                 long ret = bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(bindings.C2Tuple_BlockHashChannelMonitorZ_new(o.a, o.b == null ? 0 : o.b.ptr & ~1));
54                 Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.constr_from_ptr(ret);
55                 ret_hu_conv.ptrs_to.add(o.b);
56                 return ret_hu_conv;
57         }
58
59         /**
60          * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the error state.
61          */
62         public static Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ constructor_err(DecodeError e) {
63                 long ret = bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
64                 Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.constr_from_ptr(ret);
65                 ret_hu_conv.ptrs_to.add(e);
66                 return ret_hu_conv;
67         }
68
69 }