[C#] Update auto-generated C# bindings
[ldk-java] / c_sharp / src / org / ldk / structs / SpliceLocked.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  * A splice_locked message to be sent to or received from a peer.
11  */
12 public class SpliceLocked : CommonBase {
13         internal SpliceLocked(object _dummy, long ptr) : base(ptr) { }
14         ~SpliceLocked() {
15                 if (ptr != 0) { bindings.SpliceLocked_free(ptr); }
16         }
17
18         /**
19          * The channel ID
20          */
21         public byte[] get_channel_id() {
22                 long ret = bindings.SpliceLocked_get_channel_id(this.ptr);
23                 GC.KeepAlive(this);
24                 if (ret >= 0 && ret <= 4096) { return null; }
25                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
26                 return ret_conv;
27         }
28
29         /**
30          * The channel ID
31          */
32         public void set_channel_id(byte[] val) {
33                 bindings.SpliceLocked_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32)));
34                 GC.KeepAlive(this);
35                 GC.KeepAlive(val);
36         }
37
38         /**
39          * Constructs a new SpliceLocked given each field
40          */
41         public static SpliceLocked of(byte[] channel_id_arg) {
42                 long ret = bindings.SpliceLocked_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)));
43                 GC.KeepAlive(channel_id_arg);
44                 if (ret >= 0 && ret <= 4096) { return null; }
45                 org.ldk.structs.SpliceLocked ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.SpliceLocked(null, ret); }
46                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
47                 return ret_hu_conv;
48         }
49
50         internal long clone_ptr() {
51                 long ret = bindings.SpliceLocked_clone_ptr(this.ptr);
52                 GC.KeepAlive(this);
53                 return ret;
54         }
55
56         /**
57          * Creates a copy of the SpliceLocked
58          */
59         public SpliceLocked clone() {
60                 long ret = bindings.SpliceLocked_clone(this.ptr);
61                 GC.KeepAlive(this);
62                 if (ret >= 0 && ret <= 4096) { return null; }
63                 org.ldk.structs.SpliceLocked ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.SpliceLocked(null, ret); }
64                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
65                 return ret_hu_conv;
66         }
67
68         /**
69          * Checks if two SpliceLockeds contain equal inner contents.
70          * This ignores pointers and is_owned flags and looks at the values in fields.
71          * Two objects with NULL inner values will be considered "equal" here.
72          */
73         public bool eq(org.ldk.structs.SpliceLocked b) {
74                 bool ret = bindings.SpliceLocked_eq(this.ptr, b == null ? 0 : b.ptr);
75                 GC.KeepAlive(this);
76                 GC.KeepAlive(b);
77                 if (this != null) { this.ptrs_to.AddLast(b); };
78                 return ret;
79         }
80
81         public override bool Equals(object o) {
82                 if (!(o is SpliceLocked)) return false;
83                 return this.eq((SpliceLocked)o);
84         }
85         /**
86          * Serialize the SpliceLocked object into a byte array which can be read by SpliceLocked_read
87          */
88         public byte[] write() {
89                 long ret = bindings.SpliceLocked_write(this.ptr);
90                 GC.KeepAlive(this);
91                 if (ret >= 0 && ret <= 4096) { return null; }
92                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
93                 return ret_conv;
94         }
95
96         /**
97          * Read a SpliceLocked from a byte array, created by SpliceLocked_write
98          */
99         public static Result_SpliceLockedDecodeErrorZ read(byte[] ser) {
100                 long ret = bindings.SpliceLocked_read(InternalUtils.encodeUint8Array(ser));
101                 GC.KeepAlive(ser);
102                 if (ret >= 0 && ret <= 4096) { return null; }
103                 Result_SpliceLockedDecodeErrorZ ret_hu_conv = Result_SpliceLockedDecodeErrorZ.constr_from_ptr(ret);
104                 return ret_hu_conv;
105         }
106
107 }
108 } } }