X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FInvoiceFeatures.java;h=31bb70d1e6b48539a8c8cf58f78cfe920deef2d5;hb=1854b5cebef22ace9e9e4dd191f609818df9ce08;hp=be91f813446e8838bc38cad0501734bf763000a2;hpb=a7653cf8717b1f9df4d3f4c4bd0b1f50f3bbc230;p=ldk-java diff --git a/src/main/java/org/ldk/structs/InvoiceFeatures.java b/src/main/java/org/ldk/structs/InvoiceFeatures.java index be91f813..31bb70d1 100644 --- a/src/main/java/org/ldk/structs/InvoiceFeatures.java +++ b/src/main/java/org/ldk/structs/InvoiceFeatures.java @@ -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; @@ -26,17 +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); - if (ret < 1024) { return null; } - 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; } @@ -46,8 +60,8 @@ public class InvoiceFeatures extends CommonBase { */ public static InvoiceFeatures empty() { long ret = bindings.InvoiceFeatures_empty(); - if (ret < 1024) { return null; } - 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; } @@ -57,8 +71,8 @@ public class InvoiceFeatures extends CommonBase { */ public static InvoiceFeatures known() { long ret = bindings.InvoiceFeatures_known(); - if (ret < 1024) { return null; } - 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; } @@ -69,14 +83,7 @@ public class InvoiceFeatures extends CommonBase { */ public boolean requires_unknown_bits() { boolean ret = bindings.InvoiceFeatures_requires_unknown_bits(this.ptr); - return ret; - } - - /** - * Returns whether the `payment_secret` feature is supported. - */ - public boolean supports_payment_secret() { - boolean ret = bindings.InvoiceFeatures_supports_payment_secret(this.ptr); + Reference.reachabilityFence(this); return ret; } @@ -85,6 +92,7 @@ public class InvoiceFeatures extends CommonBase { */ public byte[] write() { byte[] ret = bindings.InvoiceFeatures_write(this.ptr); + Reference.reachabilityFence(this); return ret; } @@ -93,7 +101,8 @@ public class InvoiceFeatures extends CommonBase { */ public static Result_InvoiceFeaturesDecodeErrorZ read(byte[] ser) { long ret = bindings.InvoiceFeatures_read(ser); - if (ret < 1024) { return null; } + 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; }