6 namespace org { namespace ldk { namespace structs {
10 * Parameters needed to find a [`Route`].
12 * Passed to [`find_route`] and [`build_route_from_hops`].
14 public class RouteParameters : CommonBase {
15 internal RouteParameters(object _dummy, long ptr) : base(ptr) { }
17 if (ptr != 0) { bindings.RouteParameters_free(ptr); }
21 * The parameters of the failed payment path.
23 public PaymentParameters get_payment_params() {
24 long ret = bindings.RouteParameters_get_payment_params(this.ptr);
26 if (ret >= 0 && ret <= 4096) { return null; }
27 org.ldk.structs.PaymentParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PaymentParameters(null, ret); }
28 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
33 * The parameters of the failed payment path.
35 public void set_payment_params(org.ldk.structs.PaymentParameters val) {
36 bindings.RouteParameters_set_payment_params(this.ptr, val == null ? 0 : val.ptr);
39 if (this != null) { this.ptrs_to.AddLast(val); };
43 * The amount in msats sent on the failed payment path.
45 public long get_final_value_msat() {
46 long ret = bindings.RouteParameters_get_final_value_msat(this.ptr);
52 * The amount in msats sent on the failed payment path.
54 public void set_final_value_msat(long val) {
55 bindings.RouteParameters_set_final_value_msat(this.ptr, val);
61 * Constructs a new RouteParameters given each field
63 public static RouteParameters of(org.ldk.structs.PaymentParameters payment_params_arg, long final_value_msat_arg) {
64 long ret = bindings.RouteParameters_new(payment_params_arg == null ? 0 : payment_params_arg.ptr, final_value_msat_arg);
65 GC.KeepAlive(payment_params_arg);
66 GC.KeepAlive(final_value_msat_arg);
67 if (ret >= 0 && ret <= 4096) { return null; }
68 org.ldk.structs.RouteParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RouteParameters(null, ret); }
69 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
70 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(payment_params_arg); };
74 internal long clone_ptr() {
75 long ret = bindings.RouteParameters_clone_ptr(this.ptr);
81 * Creates a copy of the RouteParameters
83 public RouteParameters clone() {
84 long ret = bindings.RouteParameters_clone(this.ptr);
86 if (ret >= 0 && ret <= 4096) { return null; }
87 org.ldk.structs.RouteParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RouteParameters(null, ret); }
88 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
93 * Checks if two RouteParameterss contain equal inner contents.
94 * This ignores pointers and is_owned flags and looks at the values in fields.
95 * Two objects with NULL inner values will be considered "equal" here.
97 public bool eq(org.ldk.structs.RouteParameters b) {
98 bool ret = bindings.RouteParameters_eq(this.ptr, b == null ? 0 : b.ptr);
101 if (this != null) { this.ptrs_to.AddLast(b); };
105 public override bool Equals(object o) {
106 if (!(o is RouteParameters)) return false;
107 return this.eq((RouteParameters)o);
110 * Serialize the RouteParameters object into a byte array which can be read by RouteParameters_read
112 public byte[] write() {
113 byte[] ret = bindings.RouteParameters_write(this.ptr);
119 * Read a RouteParameters from a byte array, created by RouteParameters_write
121 public static Result_RouteParametersDecodeErrorZ read(byte[] ser) {
122 long ret = bindings.RouteParameters_read(ser);
124 if (ret >= 0 && ret <= 4096) { return null; }
125 Result_RouteParametersDecodeErrorZ ret_hu_conv = Result_RouteParametersDecodeErrorZ.constr_from_ptr(ret);