[Java] Update auto-generated bindings to 0.0.115
[ldk-java] / src / main / java / org / ldk / structs / Option_EventZ.java
index aa22da99f1e72c0b543deb1d1a41faa19499f948..4d28ec922afa6059120b6f4b077b5134239c172c 100644 (file)
@@ -4,11 +4,12 @@ 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;
 
 
 /**
- * An enum which can either contain a crate::lightning::util::events::Event or not
+ * An enum which can either contain a crate::lightning::events::Event or not
  */
 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
 public class Option_EventZ extends CommonBase {
@@ -30,15 +31,15 @@ public class Option_EventZ extends CommonBase {
        }
 
        /**
-        * When we're in this state, this COption_EventZ contains a crate::lightning::util::events::Event
+        * When we're in this state, this COption_EventZ contains a crate::lightning::events::Event
         */
        public final static class Some extends Option_EventZ {
-               public final Event some;
+               public final org.ldk.structs.Event some;
                private Some(long ptr, bindings.LDKCOption_EventZ.Some obj) {
                        super(null, ptr);
                        long some = obj.some;
-                       Event some_hu_conv = Event.constr_from_ptr(some);
-                       some_hu_conv.ptrs_to.add(this);
+                       org.ldk.structs.Event some_hu_conv = org.ldk.structs.Event.constr_from_ptr(some);
+                       if (some_hu_conv != null) { some_hu_conv.ptrs_to.add(this); };
                        this.some = some_hu_conv;
                }
        }
@@ -51,13 +52,15 @@ public class Option_EventZ extends CommonBase {
                }
        }
        /**
-        * Constructs a new COption_EventZ containing a crate::lightning::util::events::Event
+        * Constructs a new COption_EventZ containing a crate::lightning::events::Event
         */
-       public static Option_EventZ some(Event o) {
+       public static Option_EventZ some(org.ldk.structs.Event o) {
                long ret = bindings.COption_EventZ_some(o.ptr);
+               Reference.reachabilityFence(o);
                if (ret >= 0 && ret <= 4096) { return null; }
-               Option_EventZ ret_hu_conv = Option_EventZ.constr_from_ptr(ret);
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               org.ldk.structs.Option_EventZ ret_hu_conv = org.ldk.structs.Option_EventZ.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); };
                return ret_hu_conv;
        }
 
@@ -67,13 +70,14 @@ public class Option_EventZ extends CommonBase {
        public static Option_EventZ none() {
                long ret = bindings.COption_EventZ_none();
                if (ret >= 0 && ret <= 4096) { return null; }
-               Option_EventZ ret_hu_conv = Option_EventZ.constr_from_ptr(ret);
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               org.ldk.structs.Option_EventZ ret_hu_conv = org.ldk.structs.Option_EventZ.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
                return ret_hu_conv;
        }
 
        long clone_ptr() {
                long ret = bindings.COption_EventZ_clone_ptr(this.ptr);
+               Reference.reachabilityFence(this);
                return ret;
        }
 
@@ -83,9 +87,10 @@ public class Option_EventZ extends CommonBase {
         */
        public Option_EventZ clone() {
                long ret = bindings.COption_EventZ_clone(this.ptr);
+               Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
-               Option_EventZ ret_hu_conv = Option_EventZ.constr_from_ptr(ret);
-               ret_hu_conv.ptrs_to.add(this);
+               org.ldk.structs.Option_EventZ ret_hu_conv = org.ldk.structs.Option_EventZ.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
                return ret_hu_conv;
        }