+ /**
+ * The `payee` parameter passed to [`find_route`].
+ * This is used by `ChannelManager` to track information which may be required for retries,
+ * provided back to you via [`Event::PaymentPathFailed`].
+ *
+ * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ public void set_payee(@Nullable Payee val) {
+ bindings.Route_set_payee(this.ptr, val == null ? 0 : val.ptr & ~1);
+ }
+
+ /**
+ * Constructs a new Route given each field
+ */
+ public static Route of(RouteHop[][] paths_arg, Payee payee_arg) {
+ long ret = bindings.Route_new(paths_arg != null ? Arrays.stream(paths_arg).map(paths_arg_conv_12 -> paths_arg_conv_12 != null ? Arrays.stream(paths_arg_conv_12).mapToLong(paths_arg_conv_12_conv_10 -> paths_arg_conv_12_conv_10 == null ? 0 : paths_arg_conv_12_conv_10.ptr & ~1).toArray() : null).toArray(long[][]::new) : null, payee_arg == null ? 0 : payee_arg.ptr & ~1);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Route ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Route(null, ret); }
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Creates a copy of the Route
+ */
+ public Route clone() {
+ long ret = bindings.Route_clone(this.ptr);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Route ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Route(null, ret); }
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Checks if two Routes contain equal inner contents.
+ */
+ public long hash() {
+ long ret = bindings.Route_hash(this.ptr);
+ return ret;
+ }
+
+ /**
+ * Checks if two Routes contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(Route b) {
+ boolean ret = bindings.Route_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ this.ptrs_to.add(b);
+ return ret;
+ }
+
+ /**
+ * Returns the total amount of fees paid on this [`Route`].
+ *
+ * This doesn't include any extra payment made to the recipient, which can happen in excess of
+ * the amount passed to [`find_route`]'s `params.final_value_msat`.
+ */
+ public long get_total_fees() {
+ long ret = bindings.Route_get_total_fees(this.ptr);
+ return ret;
+ }
+
+ /**
+ * Returns the total amount paid on this [`Route`], excluding the fees.
+ */
+ public long get_total_amount() {
+ long ret = bindings.Route_get_total_amount(this.ptr);
+ return ret;
+ }
+
+ /**
+ * Serialize the Route object into a byte array which can be read by Route_read
+ */
+ public byte[] write() {
+ byte[] ret = bindings.Route_write(this.ptr);