6 namespace org { namespace ldk { namespace structs {
10 * A list of hops along a payment path terminating with a channel to the recipient.
12 public class RouteHint : CommonBase {
13 internal RouteHint(object _dummy, long ptr) : base(ptr) { }
15 if (ptr != 0) { bindings.RouteHint_free(ptr); }
18 public RouteHintHop[] get_a() {
19 long[] ret = bindings.RouteHint_get_a(this.ptr);
21 int ret_conv_14_len = ret.Length;
22 RouteHintHop[] ret_conv_14_arr = new RouteHintHop[ret_conv_14_len];
23 for (int o = 0; o < ret_conv_14_len; o++) {
24 long ret_conv_14 = ret[o];
25 org.ldk.structs.RouteHintHop ret_conv_14_hu_conv = null; if (ret_conv_14 < 0 || ret_conv_14 > 4096) { ret_conv_14_hu_conv = new org.ldk.structs.RouteHintHop(null, ret_conv_14); }
26 if (ret_conv_14_hu_conv != null) { ret_conv_14_hu_conv.ptrs_to.AddLast(this); };
27 ret_conv_14_arr[o] = ret_conv_14_hu_conv;
29 return ret_conv_14_arr;
32 public void set_a(RouteHintHop[] val) {
33 bindings.RouteHint_set_a(this.ptr, val != null ? InternalUtils.mapArray(val, val_conv_14 => val_conv_14 == null ? 0 : val_conv_14.ptr) : null);
36 foreach (RouteHintHop val_conv_14 in val) { if (this != null) { this.ptrs_to.AddLast(val_conv_14); }; };
40 * Constructs a new RouteHint given each field
42 public static RouteHint of(RouteHintHop[] a_arg) {
43 long ret = bindings.RouteHint_new(a_arg != null ? InternalUtils.mapArray(a_arg, a_arg_conv_14 => a_arg_conv_14 == null ? 0 : a_arg_conv_14.ptr) : null);
45 if (ret >= 0 && ret <= 4096) { return null; }
46 org.ldk.structs.RouteHint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RouteHint(null, ret); }
47 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
48 foreach (RouteHintHop a_arg_conv_14 in a_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(a_arg_conv_14); }; };
52 internal long clone_ptr() {
53 long ret = bindings.RouteHint_clone_ptr(this.ptr);
59 * Creates a copy of the RouteHint
61 public RouteHint clone() {
62 long ret = bindings.RouteHint_clone(this.ptr);
64 if (ret >= 0 && ret <= 4096) { return null; }
65 org.ldk.structs.RouteHint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RouteHint(null, ret); }
66 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
71 * Checks if two RouteHints contain equal inner contents.
74 long ret = bindings.RouteHint_hash(this.ptr);
79 public override int GetHashCode() {
80 return (int)this.hash();
83 * Checks if two RouteHints contain equal inner contents.
84 * This ignores pointers and is_owned flags and looks at the values in fields.
85 * Two objects with NULL inner values will be considered "equal" here.
87 public bool eq(org.ldk.structs.RouteHint b) {
88 bool ret = bindings.RouteHint_eq(this.ptr, b == null ? 0 : b.ptr);
91 if (this != null) { this.ptrs_to.AddLast(b); };
95 public override bool Equals(object o) {
96 if (!(o is RouteHint)) return false;
97 return this.eq((RouteHint)o);
100 * Serialize the RouteHint object into a byte array which can be read by RouteHint_read
102 public byte[] write() {
103 byte[] ret = bindings.RouteHint_write(this.ptr);
109 * Read a RouteHint from a byte array, created by RouteHint_write
111 public static Result_RouteHintDecodeErrorZ read(byte[] ser) {
112 long ret = bindings.RouteHint_read(ser);
114 if (ret >= 0 && ret <= 4096) { return null; }
115 Result_RouteHintDecodeErrorZ ret_hu_conv = Result_RouteHintDecodeErrorZ.constr_from_ptr(ret);