1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
7 import java.lang.ref.Reference;
8 import javax.annotation.Nullable;
14 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
15 public class TwoTuple_BlockHashChannelMonitorZ extends CommonBase {
16 TwoTuple_BlockHashChannelMonitorZ(Object _dummy, long ptr) { super(ptr); }
17 @Override @SuppressWarnings("deprecation")
18 protected void finalize() throws Throwable {
20 if (ptr != 0) { bindings.C2Tuple_BlockHashChannelMonitorZ_free(ptr); }
26 public byte[] get_a() {
27 byte[] ret = bindings.C2Tuple_BlockHashChannelMonitorZ_get_a(this.ptr);
28 Reference.reachabilityFence(this);
35 public ChannelMonitor get_b() {
36 long ret = bindings.C2Tuple_BlockHashChannelMonitorZ_get_b(this.ptr);
37 Reference.reachabilityFence(this);
38 if (ret >= 0 && ret <= 4096) { return null; }
39 org.ldk.structs.ChannelMonitor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelMonitor(null, ret); }
40 ret_hu_conv.ptrs_to.add(this);
45 long ret = bindings.C2Tuple_BlockHashChannelMonitorZ_clone_ptr(this.ptr);
46 Reference.reachabilityFence(this);
51 * Creates a new tuple which has the same data as `orig`
52 * but with all dynamically-allocated buffers duplicated in new buffers.
54 public TwoTuple_BlockHashChannelMonitorZ clone() {
55 long ret = bindings.C2Tuple_BlockHashChannelMonitorZ_clone(this.ptr);
56 Reference.reachabilityFence(this);
57 if (ret >= 0 && ret <= 4096) { return null; }
58 TwoTuple_BlockHashChannelMonitorZ ret_hu_conv = new TwoTuple_BlockHashChannelMonitorZ(null, ret);
59 ret_hu_conv.ptrs_to.add(this);
64 * Creates a new C2Tuple_BlockHashChannelMonitorZ from the contained elements.
66 public static TwoTuple_BlockHashChannelMonitorZ of(byte[] a, ChannelMonitor b) {
67 long ret = bindings.C2Tuple_BlockHashChannelMonitorZ_new(InternalUtils.check_arr_len(a, 32), b == null ? 0 : b.ptr & ~1);
68 Reference.reachabilityFence(a);
69 Reference.reachabilityFence(b);
70 if (ret >= 0 && ret <= 4096) { return null; }
71 TwoTuple_BlockHashChannelMonitorZ ret_hu_conv = new TwoTuple_BlockHashChannelMonitorZ(null, ret);
72 ret_hu_conv.ptrs_to.add(ret_hu_conv);