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 ChannelId get_channel_id() {
22 long ret = bindings.SpliceLocked_get_channel_id(this.ptr);
24 if (ret >= 0 && ret <= 4096) { return null; }
25 org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); }
26 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
33 public void set_channel_id(org.ldk.structs.ChannelId val) {
34 bindings.SpliceLocked_set_channel_id(this.ptr, val.ptr);
37 if (this != null) { this.ptrs_to.AddLast(val); };
41 * Constructs a new SpliceLocked given each field
43 public static SpliceLocked of(org.ldk.structs.ChannelId channel_id_arg) {
44 long ret = bindings.SpliceLocked_new(channel_id_arg.ptr);
45 GC.KeepAlive(channel_id_arg);
46 if (ret >= 0 && ret <= 4096) { return null; }
47 org.ldk.structs.SpliceLocked ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.SpliceLocked(null, ret); }
48 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
49 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); };
53 internal long clone_ptr() {
54 long ret = bindings.SpliceLocked_clone_ptr(this.ptr);
60 * Creates a copy of the SpliceLocked
62 public SpliceLocked clone() {
63 long ret = bindings.SpliceLocked_clone(this.ptr);
65 if (ret >= 0 && ret <= 4096) { return null; }
66 org.ldk.structs.SpliceLocked ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.SpliceLocked(null, ret); }
67 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
72 * Checks if two SpliceLockeds contain equal inner contents.
73 * This ignores pointers and is_owned flags and looks at the values in fields.
74 * Two objects with NULL inner values will be considered "equal" here.
76 public bool eq(org.ldk.structs.SpliceLocked b) {
77 bool ret = bindings.SpliceLocked_eq(this.ptr, b.ptr);
80 if (this != null) { this.ptrs_to.AddLast(b); };
84 public override bool Equals(object o) {
85 if (!(o is SpliceLocked)) return false;
86 return this.eq((SpliceLocked)o);
89 * Serialize the SpliceLocked object into a byte array which can be read by SpliceLocked_read
91 public byte[] write() {
92 long ret = bindings.SpliceLocked_write(this.ptr);
94 if (ret >= 0 && ret <= 4096) { return null; }
95 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
100 * Read a SpliceLocked from a byte array, created by SpliceLocked_write
102 public static Result_SpliceLockedDecodeErrorZ read(byte[] ser) {
103 long ret = bindings.SpliceLocked_read(InternalUtils.encodeUint8Array(ser));
105 if (ret >= 0 && ret <= 4096) { return null; }
106 Result_SpliceLockedDecodeErrorZ ret_hu_conv = Result_SpliceLockedDecodeErrorZ.constr_from_ptr(ret);