ff903acc383c93eb8ca39738eb1682b492295a78
[ldk-java] / c_sharp / src / org / ldk / structs / InvoiceSignature.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  * Recoverable signature
11  */
12 public class InvoiceSignature : CommonBase {
13         internal InvoiceSignature(object _dummy, long ptr) : base(ptr) { }
14         ~InvoiceSignature() {
15                 if (ptr != 0) { bindings.InvoiceSignature_free(ptr); }
16         }
17
18         internal long clone_ptr() {
19                 long ret = bindings.InvoiceSignature_clone_ptr(this.ptr);
20                 GC.KeepAlive(this);
21                 return ret;
22         }
23
24         /**
25          * Creates a copy of the InvoiceSignature
26          */
27         public InvoiceSignature clone() {
28                 long ret = bindings.InvoiceSignature_clone(this.ptr);
29                 GC.KeepAlive(this);
30                 if (ret >= 0 && ret <= 4096) { return null; }
31                 org.ldk.structs.InvoiceSignature ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceSignature(null, ret); }
32                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
33                 return ret_hu_conv;
34         }
35
36         /**
37          * Checks if two InvoiceSignatures contain equal inner contents.
38          */
39         public long hash() {
40                 long ret = bindings.InvoiceSignature_hash(this.ptr);
41                 GC.KeepAlive(this);
42                 return ret;
43         }
44
45         public override int GetHashCode() {
46                 return (int)this.hash();
47         }
48         /**
49          * Checks if two InvoiceSignatures contain equal inner contents.
50          * This ignores pointers and is_owned flags and looks at the values in fields.
51          * Two objects with NULL inner values will be considered "equal" here.
52          */
53         public bool eq(org.ldk.structs.InvoiceSignature b) {
54                 bool ret = bindings.InvoiceSignature_eq(this.ptr, b == null ? 0 : b.ptr);
55                 GC.KeepAlive(this);
56                 GC.KeepAlive(b);
57                 if (this != null) { this.ptrs_to.AddLast(b); };
58                 return ret;
59         }
60
61         public override bool Equals(object o) {
62                 if (!(o is InvoiceSignature)) return false;
63                 return this.eq((InvoiceSignature)o);
64         }
65 }
66 } } }