6 namespace org { namespace ldk { namespace structs {
10 * A splice_locked message to be sent to or received from a peer.
12 public class SpliceLocked : CommonBase {
13 internal SpliceLocked(object _dummy, long ptr) : base(ptr) { }
15 if (ptr != 0) { bindings.SpliceLocked_free(ptr); }
21 public byte[] get_channel_id() {
22 long ret = bindings.SpliceLocked_get_channel_id(this.ptr);
24 if (ret >= 0 && ret <= 4096) { return null; }
25 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
32 public void set_channel_id(byte[] val) {
33 bindings.SpliceLocked_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32)));
39 * Constructs a new SpliceLocked given each field
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); };
50 internal long clone_ptr() {
51 long ret = bindings.SpliceLocked_clone_ptr(this.ptr);
57 * Creates a copy of the SpliceLocked
59 public SpliceLocked clone() {
60 long ret = bindings.SpliceLocked_clone(this.ptr);
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); };
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.
73 public bool eq(org.ldk.structs.SpliceLocked b) {
74 bool ret = bindings.SpliceLocked_eq(this.ptr, b == null ? 0 : b.ptr);
77 if (this != null) { this.ptrs_to.AddLast(b); };
81 public override bool Equals(object o) {
82 if (!(o is SpliceLocked)) return false;
83 return this.eq((SpliceLocked)o);
86 * Serialize the SpliceLocked object into a byte array which can be read by SpliceLocked_read
88 public byte[] write() {
89 long ret = bindings.SpliceLocked_write(this.ptr);
91 if (ret >= 0 && ret <= 4096) { return null; }
92 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
97 * Read a SpliceLocked from a byte array, created by SpliceLocked_write
99 public static Result_SpliceLockedDecodeErrorZ read(byte[] ser) {
100 long ret = bindings.SpliceLocked_read(InternalUtils.encodeUint8Array(ser));
102 if (ret >= 0 && ret <= 4096) { return null; }
103 Result_SpliceLockedDecodeErrorZ ret_hu_conv = Result_SpliceLockedDecodeErrorZ.constr_from_ptr(ret);