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