Update auto-updated Java files
[ldk-java] / src / main / java / org / ldk / structs / InvoiceFeatures.java
index fd3bc29a780c3491f6ae4d0a582efa1f66e862bb..31bb70d1e6b48539a8c8cf58f78cfe920deef2d5 100644 (file)
@@ -4,6 +4,8 @@ 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;
 
 
 /**
@@ -25,16 +27,30 @@ public class InvoiceFeatures extends CommonBase {
         */
        public boolean eq(InvoiceFeatures b) {
                boolean ret = bindings.InvoiceFeatures_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(b);
                this.ptrs_to.add(b);
                return ret;
        }
 
+       @Override public boolean equals(Object o) {
+               if (!(o instanceof InvoiceFeatures)) return false;
+               return this.eq((InvoiceFeatures)o);
+       }
+       long clone_ptr() {
+               long ret = bindings.InvoiceFeatures_clone_ptr(this.ptr);
+               Reference.reachabilityFence(this);
+               return ret;
+       }
+
        /**
         * Creates a copy of the InvoiceFeatures
         */
        public InvoiceFeatures clone() {
                long ret = bindings.InvoiceFeatures_clone(this.ptr);
-               InvoiceFeatures ret_hu_conv = new InvoiceFeatures(null, ret);
+               Reference.reachabilityFence(this);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvoiceFeatures(null, ret); }
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }
@@ -44,7 +60,8 @@ public class InvoiceFeatures extends CommonBase {
         */
        public static InvoiceFeatures empty() {
                long ret = bindings.InvoiceFeatures_empty();
-               InvoiceFeatures ret_hu_conv = new InvoiceFeatures(null, ret);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvoiceFeatures(null, ret); }
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
        }
@@ -54,16 +71,19 @@ public class InvoiceFeatures extends CommonBase {
         */
        public static InvoiceFeatures known() {
                long ret = bindings.InvoiceFeatures_known();
-               InvoiceFeatures ret_hu_conv = new InvoiceFeatures(null, ret);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvoiceFeatures(null, ret); }
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
        }
 
        /**
-        * Returns whether the `payment_secret` feature is supported.
+        * Returns true if this `Features` object contains unknown feature flags which are set as
+        * \"required\".
         */
-       public boolean supports_payment_secret() {
-               boolean ret = bindings.InvoiceFeatures_supports_payment_secret(this.ptr);
+       public boolean requires_unknown_bits() {
+               boolean ret = bindings.InvoiceFeatures_requires_unknown_bits(this.ptr);
+               Reference.reachabilityFence(this);
                return ret;
        }
 
@@ -72,6 +92,7 @@ public class InvoiceFeatures extends CommonBase {
         */
        public byte[] write() {
                byte[] ret = bindings.InvoiceFeatures_write(this.ptr);
+               Reference.reachabilityFence(this);
                return ret;
        }
 
@@ -80,6 +101,8 @@ public class InvoiceFeatures extends CommonBase {
         */
        public static Result_InvoiceFeaturesDecodeErrorZ read(byte[] ser) {
                long ret = bindings.InvoiceFeatures_read(ser);
+               Reference.reachabilityFence(ser);
+               if (ret >= 0 && ret <= 4096) { return null; }
                Result_InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }