]> git.bitcoin.ninja Git - ldk-java/blobdiff - src/main/java/org/ldk/structs/RawDataPart.java
[Java] Update auto-generated bindings to LDK 0.0.123
[ldk-java] / src / main / java / org / ldk / structs / RawDataPart.java
index 1f9d3f0a8d6c63084c8bc5e2efaa8a83f81ff3f7..3c730c9cfd94d5086880aa6c251c5ea51b3e5188 100644 (file)
@@ -9,7 +9,7 @@ import javax.annotation.Nullable;
 
 
 /**
- * Data of the `RawInvoice` that is encoded in the data part
+ * Data of the [`RawBolt11Invoice`] that is encoded in the data part
  */
 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
 public class RawDataPart extends CommonBase {
@@ -35,8 +35,8 @@ public class RawDataPart extends CommonBase {
        /**
         * generation time of the invoice
         */
-       public void set_timestamp(PositiveTimestamp val) {
-               bindings.RawDataPart_set_timestamp(this.ptr, val == null ? 0 : val.ptr);
+       public void set_timestamp(org.ldk.structs.PositiveTimestamp val) {
+               bindings.RawDataPart_set_timestamp(this.ptr, val.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(val);
                if (this != null) { this.ptrs_to.add(val); };
@@ -47,8 +47,8 @@ public class RawDataPart extends CommonBase {
         * This ignores pointers and is_owned flags and looks at the values in fields.
         * Two objects with NULL inner values will be considered "equal" here.
         */
-       public boolean eq(RawDataPart b) {
-               boolean ret = bindings.RawDataPart_eq(this.ptr, b == null ? 0 : b.ptr);
+       public boolean eq(org.ldk.structs.RawDataPart b) {
+               boolean ret = bindings.RawDataPart_eq(this.ptr, b.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(b);
                if (this != null) { this.ptrs_to.add(b); };
@@ -77,4 +77,16 @@ public class RawDataPart extends CommonBase {
                return ret_hu_conv;
        }
 
+       /**
+        * Generates a non-cryptographic 64-bit hash of the RawDataPart.
+        */
+       public long hash() {
+               long ret = bindings.RawDataPart_hash(this.ptr);
+               Reference.reachabilityFence(this);
+               return ret;
+       }
+
+       @Override public int hashCode() {
+               return (int)this.hash();
+       }
 }