Update auto-updated Java files
[ldk-java] / src / main / java / org / ldk / structs / Option_TypeZ.java
index cb1b3e7849e488a64705943f038d7fb645f40c00..2a777b0a271f9a63111ac30e4a7ae3c5fb0b215a 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,6 +30,9 @@ 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;
                private Some(long ptr, bindings.LDKCOption_TypeZ.Some obj) {
@@ -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,7 +56,8 @@ 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 < 1024) { return null; }
+               Reference.reachabilityFence(o);
+               if (ret >= 0 && ret <= 4096) { return null; }
                Option_TypeZ ret_hu_conv = Option_TypeZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                ret_hu_conv.ptrs_to.add(o);
@@ -61,19 +69,26 @@ public class Option_TypeZ extends CommonBase {
         */
        public static Option_TypeZ none() {
                long ret = bindings.COption_TypeZ_none();
-               if (ret < 1024) { return null; }
+               if (ret >= 0 && ret <= 4096) { return null; }
                Option_TypeZ ret_hu_conv = 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 < 1024) { return null; }
+               Reference.reachabilityFence(this);
+               if (ret >= 0 && ret <= 4096) { return null; }
                Option_TypeZ ret_hu_conv = Option_TypeZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;