[Java] Properly convert strings to/from Modified UTF-8
[ldk-java] / src / main / java / org / ldk / structs / TwoTuple_BlockHashChannelManagerZ.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_BlockHashChannelManagerZ extends CommonBase {
16         TwoTuple_BlockHashChannelManagerZ(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_BlockHashChannelManagerZ_free(ptr); }
21         }
22
23         /**
24          * 
25          */
26         public byte[] get_a() {
27                 byte[] ret = bindings.C2Tuple_BlockHashChannelManagerZ_get_a(this.ptr);
28                 Reference.reachabilityFence(this);
29                 return ret;
30         }
31
32         /**
33          * 
34          */
35         public ChannelManager get_b() {
36                 long ret = bindings.C2Tuple_BlockHashChannelManagerZ_get_b(this.ptr);
37                 Reference.reachabilityFence(this);
38                 if (ret >= 0 && ret <= 4096) { return null; }
39                 org.ldk.structs.ChannelManager ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelManager(null, ret); }
40                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
41                 return ret_hu_conv;
42         }
43
44         /**
45          * Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements.
46          */
47         public static TwoTuple_BlockHashChannelManagerZ of(byte[] a, FeeEstimator b_fee_est, Watch b_chain_monitor, BroadcasterInterface b_tx_broadcaster, Router b_router, Logger b_logger, EntropySource b_entropy_source, NodeSigner b_node_signer, SignerProvider b_signer_provider, UserConfig b_config, ChainParameters b_params, int b_current_timestamp) {
48                 long ret = bindings.C2Tuple_BlockHashChannelManagerZ_new(InternalUtils.check_arr_len(a, 32), bindings.ChannelManager_new(b_fee_est.ptr, b_chain_monitor.ptr, b_tx_broadcaster.ptr, b_router.ptr, b_logger.ptr, b_entropy_source.ptr, b_node_signer.ptr, b_signer_provider.ptr, b_config == null ? 0 : b_config.ptr, b_params == null ? 0 : b_params.ptr, b_current_timestamp));
49                 Reference.reachabilityFence(a);
50                 Reference.reachabilityFence(b_fee_est);
51                 Reference.reachabilityFence(b_chain_monitor);
52                 Reference.reachabilityFence(b_tx_broadcaster);
53                 Reference.reachabilityFence(b_router);
54                 Reference.reachabilityFence(b_logger);
55                 Reference.reachabilityFence(b_entropy_source);
56                 Reference.reachabilityFence(b_node_signer);
57                 Reference.reachabilityFence(b_signer_provider);
58                 Reference.reachabilityFence(b_config);
59                 Reference.reachabilityFence(b_params);
60                 Reference.reachabilityFence(b_current_timestamp);
61                 if (ret >= 0 && ret <= 4096) { return null; }
62                 TwoTuple_BlockHashChannelManagerZ ret_hu_conv = new TwoTuple_BlockHashChannelManagerZ(null, ret);
63                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
64                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_fee_est); };
65                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_chain_monitor); };
66                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_tx_broadcaster); };
67                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_router); };
68                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_logger); };
69                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_entropy_source); };
70                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_node_signer); };
71                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_signer_provider); };
72                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_config); };
73                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_params); };
74                 return ret_hu_conv;
75         }
76
77 }