[C#] Update auto-generated C# bindings
[ldk-java] / c_sharp / src / org / ldk / structs / PayeePubKey.cs
1 using org.ldk.impl;
2 using org.ldk.enums;
3 using org.ldk.util;
4 using System;
5
6 namespace org { namespace ldk { namespace structs {
7
8
9 /**
10  * Payee public key
11  */
12 public class PayeePubKey : CommonBase {
13         internal PayeePubKey(object _dummy, long ptr) : base(ptr) { }
14         ~PayeePubKey() {
15                 if (ptr != 0) { bindings.PayeePubKey_free(ptr); }
16         }
17
18         public byte[] get_a() {
19                 long ret = bindings.PayeePubKey_get_a(this.ptr);
20                 GC.KeepAlive(this);
21                 if (ret >= 0 && ret <= 4096) { return null; }
22                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
23                 return ret_conv;
24         }
25
26         public void set_a(byte[] val) {
27                 bindings.PayeePubKey_set_a(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33)));
28                 GC.KeepAlive(this);
29                 GC.KeepAlive(val);
30         }
31
32         /**
33          * Constructs a new PayeePubKey given each field
34          */
35         public static PayeePubKey of(byte[] a_arg) {
36                 long ret = bindings.PayeePubKey_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(a_arg, 33)));
37                 GC.KeepAlive(a_arg);
38                 if (ret >= 0 && ret <= 4096) { return null; }
39                 org.ldk.structs.PayeePubKey ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PayeePubKey(null, ret); }
40                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
41                 return ret_hu_conv;
42         }
43
44         internal long clone_ptr() {
45                 long ret = bindings.PayeePubKey_clone_ptr(this.ptr);
46                 GC.KeepAlive(this);
47                 return ret;
48         }
49
50         /**
51          * Creates a copy of the PayeePubKey
52          */
53         public PayeePubKey clone() {
54                 long ret = bindings.PayeePubKey_clone(this.ptr);
55                 GC.KeepAlive(this);
56                 if (ret >= 0 && ret <= 4096) { return null; }
57                 org.ldk.structs.PayeePubKey ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PayeePubKey(null, ret); }
58                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
59                 return ret_hu_conv;
60         }
61
62         /**
63          * Generates a non-cryptographic 64-bit hash of the PayeePubKey.
64          */
65         public long hash() {
66                 long ret = bindings.PayeePubKey_hash(this.ptr);
67                 GC.KeepAlive(this);
68                 return ret;
69         }
70
71         public override int GetHashCode() {
72                 return (int)this.hash();
73         }
74         /**
75          * Checks if two PayeePubKeys contain equal inner contents.
76          * This ignores pointers and is_owned flags and looks at the values in fields.
77          * Two objects with NULL inner values will be considered "equal" here.
78          */
79         public bool eq(org.ldk.structs.PayeePubKey b) {
80                 bool ret = bindings.PayeePubKey_eq(this.ptr, b == null ? 0 : b.ptr);
81                 GC.KeepAlive(this);
82                 GC.KeepAlive(b);
83                 if (this != null) { this.ptrs_to.AddLast(b); };
84                 return ret;
85         }
86
87         public override bool Equals(object o) {
88                 if (!(o is PayeePubKey)) return false;
89                 return this.eq((PayeePubKey)o);
90         }
91 }
92 } } }