Update auto-generated bindings to 0.0.103
[ldk-java] / src / main / java / org / ldk / structs / RouteHintHop.java
index ad4a93b8ee1c9dce9a2b369a54490c482fe8f211..86018744e02e99387810cb187d8bb09fb930c008 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -53,7 +54,8 @@ public class RouteHintHop extends CommonBase {
         */
        public RoutingFees get_fees() {
                long ret = bindings.RouteHintHop_get_fees(this.ptr);
-               RoutingFees ret_hu_conv = new RoutingFees(null, ret);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               RoutingFees ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RoutingFees(null, ret); }
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }
@@ -63,7 +65,6 @@ public class RouteHintHop extends CommonBase {
         */
        public void set_fees(RoutingFees val) {
                bindings.RouteHintHop_set_fees(this.ptr, val == null ? 0 : val.ptr & ~1);
-               this.ptrs_to.add(val);
        }
 
        /**
@@ -86,6 +87,7 @@ public class RouteHintHop extends CommonBase {
         */
        public Option_u64Z get_htlc_minimum_msat() {
                long ret = bindings.RouteHintHop_get_htlc_minimum_msat(this.ptr);
+               if (ret >= 0 && ret <= 4096) { return null; }
                Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -103,6 +105,7 @@ public class RouteHintHop extends CommonBase {
         */
        public Option_u64Z get_htlc_maximum_msat() {
                long ret = bindings.RouteHintHop_get_htlc_maximum_msat(this.ptr);
+               if (ret >= 0 && ret <= 4096) { return null; }
                Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -120,12 +123,31 @@ public class RouteHintHop extends CommonBase {
         */
        public static RouteHintHop of(byte[] src_node_id_arg, long short_channel_id_arg, RoutingFees fees_arg, short cltv_expiry_delta_arg, Option_u64Z htlc_minimum_msat_arg, Option_u64Z htlc_maximum_msat_arg) {
                long ret = bindings.RouteHintHop_new(src_node_id_arg, short_channel_id_arg, fees_arg == null ? 0 : fees_arg.ptr & ~1, cltv_expiry_delta_arg, htlc_minimum_msat_arg.ptr, htlc_maximum_msat_arg.ptr);
-               RouteHintHop ret_hu_conv = new RouteHintHop(null, ret);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               RouteHintHop ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RouteHintHop(null, ret); }
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
-               ret_hu_conv.ptrs_to.add(fees_arg);
                return ret_hu_conv;
        }
 
+       /**
+        * Creates a copy of the RouteHintHop
+        */
+       public RouteHintHop clone() {
+               long ret = bindings.RouteHintHop_clone(this.ptr);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               RouteHintHop ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RouteHintHop(null, ret); }
+               ret_hu_conv.ptrs_to.add(this);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Checks if two RouteHintHops contain equal inner contents.
+        */
+       public long hash() {
+               long ret = bindings.RouteHintHop_hash(this.ptr);
+               return ret;
+       }
+
        /**
         * Checks if two RouteHintHops contain equal inner contents.
         * This ignores pointers and is_owned flags and looks at the values in fields.
@@ -138,12 +160,20 @@ public class RouteHintHop extends CommonBase {
        }
 
        /**
-        * Creates a copy of the RouteHintHop
+        * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read
         */
-       public RouteHintHop clone() {
-               long ret = bindings.RouteHintHop_clone(this.ptr);
-               RouteHintHop ret_hu_conv = new RouteHintHop(null, ret);
-               ret_hu_conv.ptrs_to.add(this);
+       public byte[] write() {
+               byte[] ret = bindings.RouteHintHop_write(this.ptr);
+               return ret;
+       }
+
+       /**
+        * Read a RouteHintHop from a byte array, created by RouteHintHop_write
+        */
+       public static Result_RouteHintHopDecodeErrorZ read(byte[] ser) {
+               long ret = bindings.RouteHintHop_read(ser);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               Result_RouteHintHopDecodeErrorZ ret_hu_conv = Result_RouteHintHopDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }