Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / PayeePubKey.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 javax.annotation.Nullable;
8
9
10 /**
11  * Payee public key
12  */
13 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
14 public class PayeePubKey extends CommonBase {
15         PayeePubKey(Object _dummy, long ptr) { super(ptr); }
16         @Override @SuppressWarnings("deprecation")
17         protected void finalize() throws Throwable {
18                 super.finalize();
19                 if (ptr != 0) { bindings.PayeePubKey_free(ptr); }
20         }
21
22         public byte[] get_a() {
23                 byte[] ret = bindings.PayeePubKey_get_a(this.ptr);
24                 return ret;
25         }
26
27         public void set_a(byte[] val) {
28                 bindings.PayeePubKey_set_a(this.ptr, InternalUtils.check_arr_len(val, 33));
29         }
30
31         /**
32          * Constructs a new PayeePubKey given each field
33          */
34         public static PayeePubKey of(byte[] a_arg) {
35                 long ret = bindings.PayeePubKey_new(InternalUtils.check_arr_len(a_arg, 33));
36                 if (ret >= 0 && ret <= 4096) { return null; }
37                 PayeePubKey ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PayeePubKey(null, ret); }
38                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
39                 return ret_hu_conv;
40         }
41
42         long clone_ptr() {
43                 long ret = bindings.PayeePubKey_clone_ptr(this.ptr);
44                 return ret;
45         }
46
47         /**
48          * Creates a copy of the PayeePubKey
49          */
50         public PayeePubKey clone() {
51                 long ret = bindings.PayeePubKey_clone(this.ptr);
52                 if (ret >= 0 && ret <= 4096) { return null; }
53                 PayeePubKey ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PayeePubKey(null, ret); }
54                 ret_hu_conv.ptrs_to.add(this);
55                 return ret_hu_conv;
56         }
57
58         /**
59          * Checks if two PayeePubKeys contain equal inner contents.
60          */
61         public long hash() {
62                 long ret = bindings.PayeePubKey_hash(this.ptr);
63                 return ret;
64         }
65
66         /**
67          * Checks if two PayeePubKeys contain equal inner contents.
68          * This ignores pointers and is_owned flags and looks at the values in fields.
69          * Two objects with NULL inner values will be considered "equal" here.
70          */
71         public boolean eq(PayeePubKey b) {
72                 boolean ret = bindings.PayeePubKey_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
73                 this.ptrs_to.add(b);
74                 return ret;
75         }
76
77 }