Update auto-generated bindings to 0.0.103
[ldk-java] / src / main / java / org / ldk / structs / RouteHint.java
index d2bc2616a08456a2426ea66498cff0bcb26d4070..1b0ddef811b8e156055cf1a91c75bec8bdec11ce 100644 (file)
@@ -4,10 +4,11 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
- * A channel descriptor which provides a last-hop route to get_route
+ * A list of hops along a payment path terminating with a channel to the recipient.
  */
 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
 public class RouteHint extends CommonBase {
@@ -18,76 +19,78 @@ public class RouteHint extends CommonBase {
                if (ptr != 0) { bindings.RouteHint_free(ptr); }
        }
 
-       /**
-        * The node_id of the non-target end of the route
-        */
-       public byte[] get_src_node_id() {
-               byte[] ret = bindings.RouteHint_get_src_node_id(this.ptr);
-               return ret;
-       }
-
-       /**
-        * The node_id of the non-target end of the route
-        */
-       public void set_src_node_id(byte[] val) {
-               bindings.RouteHint_set_src_node_id(this.ptr, val);
+       public RouteHintHop[] get_a() {
+               long[] ret = bindings.RouteHint_get_a(this.ptr);
+               RouteHintHop[] ret_conv_14_arr = new RouteHintHop[ret.length];
+               for (int o = 0; o < ret.length; o++) {
+                       long ret_conv_14 = ret[o];
+                       RouteHintHop ret_conv_14_hu_conv = null; if (ret_conv_14 < 0 || ret_conv_14 > 4096) { ret_conv_14_hu_conv = new RouteHintHop(null, ret_conv_14); }
+                       ret_conv_14_hu_conv.ptrs_to.add(this);
+                       ret_conv_14_arr[o] = ret_conv_14_hu_conv;
+               }
+               return ret_conv_14_arr;
        }
 
-       /**
-        * The short_channel_id of this channel
-        */
-       public long get_short_channel_id() {
-               long ret = bindings.RouteHint_get_short_channel_id(this.ptr);
-               return ret;
+       public void set_a(RouteHintHop[] val) {
+               bindings.RouteHint_set_a(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_14 -> val_conv_14 == null ? 0 : val_conv_14.ptr & ~1).toArray() : null);
        }
 
        /**
-        * The short_channel_id of this channel
+        * Constructs a new RouteHint given each field
         */
-       public void set_short_channel_id(long val) {
-               bindings.RouteHint_set_short_channel_id(this.ptr, val);
+       public static RouteHint of(RouteHintHop[] a_arg) {
+               long ret = bindings.RouteHint_new(a_arg != null ? Arrays.stream(a_arg).mapToLong(a_arg_conv_14 -> a_arg_conv_14 == null ? 0 : a_arg_conv_14.ptr & ~1).toArray() : null);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               RouteHint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RouteHint(null, ret); }
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
        }
 
        /**
-        * The fees which must be paid to use this channel
+        * Creates a copy of the RouteHint
         */
-       public RoutingFees get_fees() {
-               long ret = bindings.RouteHint_get_fees(this.ptr);
-               RoutingFees ret_hu_conv = new RoutingFees(null, ret);
+       public RouteHint clone() {
+               long ret = bindings.RouteHint_clone(this.ptr);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               RouteHint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RouteHint(null, ret); }
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }
 
        /**
-        * The fees which must be paid to use this channel
+        * Checks if two RouteHints contain equal inner contents.
         */
-       public void set_fees(RoutingFees val) {
-               bindings.RouteHint_set_fees(this.ptr, val == null ? 0 : val.ptr & ~1);
-               this.ptrs_to.add(val);
+       public long hash() {
+               long ret = bindings.RouteHint_hash(this.ptr);
+               return ret;
        }
 
        /**
-        * The difference in CLTV values between this node and the next node.
+        * Checks if two RouteHints 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 short get_cltv_expiry_delta() {
-               short ret = bindings.RouteHint_get_cltv_expiry_delta(this.ptr);
+       public boolean eq(RouteHint b) {
+               boolean ret = bindings.RouteHint_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+               this.ptrs_to.add(b);
                return ret;
        }
 
        /**
-        * The difference in CLTV values between this node and the next node.
+        * Serialize the RouteHint object into a byte array which can be read by RouteHint_read
         */
-       public void set_cltv_expiry_delta(short val) {
-               bindings.RouteHint_set_cltv_expiry_delta(this.ptr, val);
+       public byte[] write() {
+               byte[] ret = bindings.RouteHint_write(this.ptr);
+               return ret;
        }
 
        /**
-        * Creates a copy of the RouteHint
+        * Read a RouteHint from a byte array, created by RouteHint_write
         */
-       public RouteHint clone() {
-               long ret = bindings.RouteHint_clone(this.ptr);
-               RouteHint ret_hu_conv = new RouteHint(null, ret);
-               ret_hu_conv.ptrs_to.add(this);
+       public static Result_RouteHintDecodeErrorZ read(byte[] ser) {
+               long ret = bindings.RouteHint_read(ser);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               Result_RouteHintDecodeErrorZ ret_hu_conv = Result_RouteHintDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }