]> git.bitcoin.ninja Git - ldk-java/blob - c_sharp/src/org/ldk/structs/RawDataPart.cs
Update CI references to LDK 0.0.124 drop stale memchr pins
[ldk-java] / c_sharp / src / org / ldk / structs / RawDataPart.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  * Data of the [`RawBolt11Invoice`] that is encoded in the data part
11  */
12 public class RawDataPart : CommonBase {
13         internal RawDataPart(object _dummy, long ptr) : base(ptr) { }
14         ~RawDataPart() {
15                 if (ptr != 0) { bindings.RawDataPart_free(ptr); }
16         }
17
18         /**
19          * generation time of the invoice
20          */
21         public PositiveTimestamp get_timestamp() {
22                 long ret = bindings.RawDataPart_get_timestamp(this.ptr);
23                 GC.KeepAlive(this);
24                 if (ret >= 0 && ret <= 4096) { return null; }
25                 org.ldk.structs.PositiveTimestamp ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PositiveTimestamp(null, ret); }
26                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
27                 return ret_hu_conv;
28         }
29
30         /**
31          * generation time of the invoice
32          */
33         public void set_timestamp(org.ldk.structs.PositiveTimestamp val) {
34                 bindings.RawDataPart_set_timestamp(this.ptr, val.ptr);
35                 GC.KeepAlive(this);
36                 GC.KeepAlive(val);
37         }
38
39         /**
40          * Checks if two RawDataParts contain equal inner contents.
41          * This ignores pointers and is_owned flags and looks at the values in fields.
42          * Two objects with NULL inner values will be considered "equal" here.
43          */
44         public bool eq(org.ldk.structs.RawDataPart b) {
45                 bool ret = bindings.RawDataPart_eq(this.ptr, b.ptr);
46                 GC.KeepAlive(this);
47                 GC.KeepAlive(b);
48                 if (this != null) { this.ptrs_to.AddLast(b); };
49                 return ret;
50         }
51
52         public override bool Equals(object o) {
53                 if (!(o is RawDataPart)) return false;
54                 return this.eq((RawDataPart)o);
55         }
56         internal long clone_ptr() {
57                 long ret = bindings.RawDataPart_clone_ptr(this.ptr);
58                 GC.KeepAlive(this);
59                 return ret;
60         }
61
62         /**
63          * Creates a copy of the RawDataPart
64          */
65         public RawDataPart clone() {
66                 long ret = bindings.RawDataPart_clone(this.ptr);
67                 GC.KeepAlive(this);
68                 if (ret >= 0 && ret <= 4096) { return null; }
69                 org.ldk.structs.RawDataPart ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RawDataPart(null, ret); }
70                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
71                 return ret_hu_conv;
72         }
73
74         /**
75          * Generates a non-cryptographic 64-bit hash of the RawDataPart.
76          */
77         public long hash() {
78                 long ret = bindings.RawDataPart_hash(this.ptr);
79                 GC.KeepAlive(this);
80                 return ret;
81         }
82
83         public override int GetHashCode() {
84                 return (int)this.hash();
85         }
86 }
87 } } }