1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
7 import javax.annotation.Nullable;
11 * A list of hops along a payment path terminating with a channel to the recipient.
13 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
14 public class RouteHint extends CommonBase {
15 RouteHint(Object _dummy, long ptr) { super(ptr); }
16 @Override @SuppressWarnings("deprecation")
17 protected void finalize() throws Throwable {
19 if (ptr != 0) { bindings.RouteHint_free(ptr); }
23 * Creates a copy of the RouteHint
25 public RouteHint clone() {
26 long ret = bindings.RouteHint_clone(this.ptr);
27 if (ret < 1024) { return null; }
28 RouteHint ret_hu_conv = new RouteHint(null, ret);
29 ret_hu_conv.ptrs_to.add(this);
34 * Checks if two RouteHints contain equal inner contents.
37 long ret = bindings.RouteHint_hash(this.ptr);
42 * Checks if two RouteHints contain equal inner contents.
43 * This ignores pointers and is_owned flags and looks at the values in fields.
44 * Two objects with NULL inner values will be considered "equal" here.
46 public boolean eq(RouteHint b) {
47 boolean ret = bindings.RouteHint_eq(this.ptr, b == null ? 0 : b.ptr & ~1);