6 namespace org { namespace ldk { namespace structs {
10 * Private routing information
13 * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
15 public class PrivateRoute : CommonBase {
16 internal PrivateRoute(object _dummy, long ptr) : base(ptr) { }
18 if (ptr != 0) { bindings.PrivateRoute_free(ptr); }
21 internal long clone_ptr() {
22 long ret = bindings.PrivateRoute_clone_ptr(this.ptr);
28 * Creates a copy of the PrivateRoute
30 public PrivateRoute clone() {
31 long ret = bindings.PrivateRoute_clone(this.ptr);
33 if (ret >= 0 && ret <= 4096) { return null; }
34 org.ldk.structs.PrivateRoute ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PrivateRoute(null, ret); }
35 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
40 * Checks if two PrivateRoutes contain equal inner contents.
43 long ret = bindings.PrivateRoute_hash(this.ptr);
48 public override int GetHashCode() {
49 return (int)this.hash();
52 * Checks if two PrivateRoutes contain equal inner contents.
53 * This ignores pointers and is_owned flags and looks at the values in fields.
54 * Two objects with NULL inner values will be considered "equal" here.
56 public bool eq(org.ldk.structs.PrivateRoute b) {
57 bool ret = bindings.PrivateRoute_eq(this.ptr, b == null ? 0 : b.ptr);
60 if (this != null) { this.ptrs_to.AddLast(b); };
64 public override bool Equals(object o) {
65 if (!(o is PrivateRoute)) return false;
66 return this.eq((PrivateRoute)o);
69 * Creates a new (partial) route from a list of hops
71 public static Result_PrivateRouteCreationErrorZ of(org.ldk.structs.RouteHint hops) {
72 long ret = bindings.PrivateRoute_new(hops == null ? 0 : hops.ptr);
74 if (ret >= 0 && ret <= 4096) { return null; }
75 Result_PrivateRouteCreationErrorZ ret_hu_conv = Result_PrivateRouteCreationErrorZ.constr_from_ptr(ret);
76 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(hops); };
81 * Returns the underlying list of hops
83 public RouteHint into_inner() {
84 long ret = bindings.PrivateRoute_into_inner(this.ptr);
86 if (ret >= 0 && ret <= 4096) { return null; }
87 org.ldk.structs.RouteHint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RouteHint(null, ret); }
88 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
89 if (this != null) { this.ptrs_to.AddLast(this); };