Skip object reference adding when cloning within the FFI on to-Rust object passing
[ldk-java] / src / main / java / org / ldk / structs / InitFeatures.java
index 1844618d57e0c2e7f149f47845961cb9b45054cb..6b89bcb0c20061b1091fafcc607fe750c73e6802 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;
 
 
 /**
@@ -34,6 +35,7 @@ public class InitFeatures extends CommonBase {
         */
        public InitFeatures clone() {
                long ret = bindings.InitFeatures_clone(this.ptr);
+               if (ret < 1024) { return null; }
                InitFeatures ret_hu_conv = new InitFeatures(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -44,6 +46,7 @@ public class InitFeatures extends CommonBase {
         */
        public static InitFeatures empty() {
                long ret = bindings.InitFeatures_empty();
+               if (ret < 1024) { return null; }
                InitFeatures ret_hu_conv = new InitFeatures(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -54,11 +57,21 @@ public class InitFeatures extends CommonBase {
         */
        public static InitFeatures known() {
                long ret = bindings.InitFeatures_known();
+               if (ret < 1024) { return null; }
                InitFeatures ret_hu_conv = new InitFeatures(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
        }
 
+       /**
+        * Returns true if this `Features` object contains unknown feature flags which are set as
+        * \"required\".
+        */
+       public boolean requires_unknown_bits() {
+               boolean ret = bindings.InitFeatures_requires_unknown_bits(this.ptr);
+               return ret;
+       }
+
        /**
         * Returns whether the `payment_secret` feature is supported.
         */
@@ -80,6 +93,7 @@ public class InitFeatures extends CommonBase {
         */
        public static Result_InitFeaturesDecodeErrorZ read(byte[] ser) {
                long ret = bindings.InitFeatures_read(ser);
+               if (ret < 1024) { return null; }
                Result_InitFeaturesDecodeErrorZ ret_hu_conv = Result_InitFeaturesDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }