[Java] Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / Option_TypeZ.java
index 8df2c9949945726384f8a6229ed802f6f6a23be8..f58fb1fc0420ef7b178a42bab097d1ba1b2ffea8 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import java.lang.ref.Reference;
 import javax.annotation.Nullable;
 
 
@@ -29,8 +30,11 @@ public class Option_TypeZ extends CommonBase {
                assert false; return null; // Unreachable without extending the (internal) bindings interface
        }
 
+       /**
+        * When we're in this state, this COption_TypeZ contains a crate::lightning::ln::wire::Type
+        */
        public final static class Some extends Option_TypeZ {
-               public final Type some;
+               public final org.ldk.structs.Type some;
                private Some(long ptr, bindings.LDKCOption_TypeZ.Some obj) {
                        super(null, ptr);
                        long some = obj.some;
@@ -39,6 +43,9 @@ public class Option_TypeZ extends CommonBase {
                        this.some = ret_hu_conv;
                }
        }
+       /**
+        * When we're in this state, this COption_TypeZ contains nothing
+        */
        public final static class None extends Option_TypeZ {
                private None(long ptr, bindings.LDKCOption_TypeZ.None obj) {
                        super(null, ptr);
@@ -49,8 +56,9 @@ public class Option_TypeZ extends CommonBase {
         */
        public static Option_TypeZ some(Type o) {
                long ret = bindings.COption_TypeZ_some(o == null ? 0 : o.ptr);
-               if (ret >= 0 && ret < 1024) { return null; }
-               Option_TypeZ ret_hu_conv = Option_TypeZ.constr_from_ptr(ret);
+               Reference.reachabilityFence(o);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.Option_TypeZ ret_hu_conv = org.ldk.structs.Option_TypeZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -61,20 +69,27 @@ public class Option_TypeZ extends CommonBase {
         */
        public static Option_TypeZ none() {
                long ret = bindings.COption_TypeZ_none();
-               if (ret >= 0 && ret < 1024) { return null; }
-               Option_TypeZ ret_hu_conv = Option_TypeZ.constr_from_ptr(ret);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.Option_TypeZ ret_hu_conv = org.ldk.structs.Option_TypeZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
        }
 
+       long clone_ptr() {
+               long ret = bindings.COption_TypeZ_clone_ptr(this.ptr);
+               Reference.reachabilityFence(this);
+               return ret;
+       }
+
        /**
         * Creates a new COption_TypeZ which has the same data as `orig`
         * but with all dynamically-allocated buffers duplicated in new buffers.
         */
        public Option_TypeZ clone() {
                long ret = bindings.COption_TypeZ_clone(this.ptr);
-               if (ret >= 0 && ret < 1024) { return null; }
-               Option_TypeZ ret_hu_conv = Option_TypeZ.constr_from_ptr(ret);
+               Reference.reachabilityFence(this);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.Option_TypeZ ret_hu_conv = org.ldk.structs.Option_TypeZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }