X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FBolt12InvoiceFeatures.java;h=6dbd72cc168e8cb23cb9142e513cf3803bf85e3b;hb=ffdd56c967087cba7548599934585b8a9a3102e2;hp=6874bc027d1649b62ee2b968bb0095355d62c3b0;hpb=7811d2191440c55034e1abfbf3be442d4b25481b;p=ldk-java diff --git a/src/main/java/org/ldk/structs/Bolt12InvoiceFeatures.java b/src/main/java/org/ldk/structs/Bolt12InvoiceFeatures.java index 6874bc02..6dbd72cc 100644 --- a/src/main/java/org/ldk/structs/Bolt12InvoiceFeatures.java +++ b/src/main/java/org/ldk/structs/Bolt12InvoiceFeatures.java @@ -26,7 +26,7 @@ public class Bolt12InvoiceFeatures extends CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public boolean eq(org.ldk.structs.Bolt12InvoiceFeatures b) { - boolean ret = bindings.Bolt12InvoiceFeatures_eq(this.ptr, b == null ? 0 : b.ptr); + boolean ret = bindings.Bolt12InvoiceFeatures_eq(this.ptr, b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); if (this != null) { this.ptrs_to.add(b); }; @@ -55,6 +55,18 @@ public class Bolt12InvoiceFeatures extends CommonBase { return ret_hu_conv; } + /** + * Generates a non-cryptographic 64-bit hash of the Bolt12InvoiceFeatures. + */ + public long hash() { + long ret = bindings.Bolt12InvoiceFeatures_hash(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + @Override public int hashCode() { + return (int)this.hash(); + } /** * Create a blank Features with no features set */ @@ -70,7 +82,7 @@ public class Bolt12InvoiceFeatures extends CommonBase { * Returns true if this `Features` object contains required features unknown by `other`. */ public boolean requires_unknown_bits_from(org.ldk.structs.Bolt12InvoiceFeatures other) { - boolean ret = bindings.Bolt12InvoiceFeatures_requires_unknown_bits_from(this.ptr, other == null ? 0 : other.ptr); + boolean ret = bindings.Bolt12InvoiceFeatures_requires_unknown_bits_from(this.ptr, other.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(other); if (this != null) { this.ptrs_to.add(other); };