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_PaymentHashPaymentSecretZ extends CommonBase {
16 TwoTuple_PaymentHashPaymentSecretZ(Object _dummy, long ptr) { super(ptr); }
17 @Override @SuppressWarnings("deprecation")
18 protected void finalize() throws Throwable {
20 if (ptr != 0) { bindings.C2Tuple_PaymentHashPaymentSecretZ_free(ptr); }
26 public byte[] get_a() {
27 byte[] ret = bindings.C2Tuple_PaymentHashPaymentSecretZ_get_a(this.ptr);
28 Reference.reachabilityFence(this);
35 public byte[] get_b() {
36 byte[] ret = bindings.C2Tuple_PaymentHashPaymentSecretZ_get_b(this.ptr);
37 Reference.reachabilityFence(this);
42 long ret = bindings.C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(this.ptr);
43 Reference.reachabilityFence(this);
48 * Creates a new tuple which has the same data as `orig`
49 * but with all dynamically-allocated buffers duplicated in new buffers.
51 public TwoTuple_PaymentHashPaymentSecretZ clone() {
52 long ret = bindings.C2Tuple_PaymentHashPaymentSecretZ_clone(this.ptr);
53 Reference.reachabilityFence(this);
54 if (ret >= 0 && ret <= 4096) { return null; }
55 TwoTuple_PaymentHashPaymentSecretZ ret_hu_conv = new TwoTuple_PaymentHashPaymentSecretZ(null, ret);
56 ret_hu_conv.ptrs_to.add(this);
61 * Creates a new C2Tuple_PaymentHashPaymentSecretZ from the contained elements.
63 public static TwoTuple_PaymentHashPaymentSecretZ of(byte[] a, byte[] b) {
64 long ret = bindings.C2Tuple_PaymentHashPaymentSecretZ_new(InternalUtils.check_arr_len(a, 32), InternalUtils.check_arr_len(b, 32));
65 Reference.reachabilityFence(a);
66 Reference.reachabilityFence(b);
67 if (ret >= 0 && ret <= 4096) { return null; }
68 TwoTuple_PaymentHashPaymentSecretZ ret_hu_conv = new TwoTuple_PaymentHashPaymentSecretZ(null, ret);
69 ret_hu_conv.ptrs_to.add(ret_hu_conv);