Update auto-generated bindings to 0.0.103
[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, val);
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(a_arg);
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         /**
43          * Creates a copy of the PayeePubKey
44          */
45         public PayeePubKey clone() {
46                 long ret = bindings.PayeePubKey_clone(this.ptr);
47                 if (ret >= 0 && ret <= 4096) { return null; }
48                 PayeePubKey ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PayeePubKey(null, ret); }
49                 ret_hu_conv.ptrs_to.add(this);
50                 return ret_hu_conv;
51         }
52
53         /**
54          * Checks if two PayeePubKeys contain equal inner contents.
55          */
56         public long hash() {
57                 long ret = bindings.PayeePubKey_hash(this.ptr);
58                 return ret;
59         }
60
61         /**
62          * Checks if two PayeePubKeys contain equal inner contents.
63          * This ignores pointers and is_owned flags and looks at the values in fields.
64          * Two objects with NULL inner values will be considered "equal" here.
65          */
66         public boolean eq(PayeePubKey b) {
67                 boolean ret = bindings.PayeePubKey_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
68                 this.ptrs_to.add(b);
69                 return ret;
70         }
71
72 }