6 namespace org { namespace ldk { namespace structs {
10 * Invalid inbound onion payment.
12 public class InboundHTLCErr : CommonBase {
13 internal InboundHTLCErr(object _dummy, long ptr) : base(ptr) { }
15 if (ptr != 0) { bindings.InboundHTLCErr_free(ptr); }
21 public short get_err_code() {
22 short ret = bindings.InboundHTLCErr_get_err_code(this.ptr);
30 public void set_err_code(short val) {
31 bindings.InboundHTLCErr_set_err_code(this.ptr, val);
37 * Data attached to this error.
39 * Returns a copy of the field.
41 public byte[] get_err_data() {
42 long ret = bindings.InboundHTLCErr_get_err_data(this.ptr);
44 if (ret >= 0 && ret <= 4096) { return null; }
45 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
50 * Data attached to this error.
52 public void set_err_data(byte[] val) {
53 bindings.InboundHTLCErr_set_err_data(this.ptr, InternalUtils.encodeUint8Array(val));
61 public string get_msg() {
62 long ret = bindings.InboundHTLCErr_get_msg(this.ptr);
64 if (ret >= 0 && ret <= 4096) { return null; }
65 string ret_conv = InternalUtils.decodeString(ret);
72 public void set_msg(string val) {
73 bindings.InboundHTLCErr_set_msg(this.ptr, InternalUtils.encodeString(val));
79 * Constructs a new InboundHTLCErr given each field
81 public static InboundHTLCErr of(short err_code_arg, byte[] err_data_arg, string msg_arg) {
82 long ret = bindings.InboundHTLCErr_new(err_code_arg, InternalUtils.encodeUint8Array(err_data_arg), InternalUtils.encodeString(msg_arg));
83 GC.KeepAlive(err_code_arg);
84 GC.KeepAlive(err_data_arg);
85 GC.KeepAlive(msg_arg);
86 if (ret >= 0 && ret <= 4096) { return null; }
87 org.ldk.structs.InboundHTLCErr ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InboundHTLCErr(null, ret); }
88 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
92 internal long clone_ptr() {
93 long ret = bindings.InboundHTLCErr_clone_ptr(this.ptr);
99 * Creates a copy of the InboundHTLCErr
101 public InboundHTLCErr clone() {
102 long ret = bindings.InboundHTLCErr_clone(this.ptr);
104 if (ret >= 0 && ret <= 4096) { return null; }
105 org.ldk.structs.InboundHTLCErr ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InboundHTLCErr(null, ret); }
106 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
111 * Generates a non-cryptographic 64-bit hash of the InboundHTLCErr.
114 long ret = bindings.InboundHTLCErr_hash(this.ptr);
119 public override int GetHashCode() {
120 return (int)this.hash();
123 * Checks if two InboundHTLCErrs contain equal inner contents.
124 * This ignores pointers and is_owned flags and looks at the values in fields.
125 * Two objects with NULL inner values will be considered "equal" here.
127 public bool eq(org.ldk.structs.InboundHTLCErr b) {
128 bool ret = bindings.InboundHTLCErr_eq(this.ptr, b.ptr);
131 if (this != null) { this.ptrs_to.AddLast(b); };
135 public override bool Equals(object o) {
136 if (!(o is InboundHTLCErr)) return false;
137 return this.eq((InboundHTLCErr)o);