Merge pull request #161 from TheBlueMatt/main
[ldk-java] / src / main / java / org / ldk / structs / Refund.java
index f31b52dff25cd3199aff81107bd2882bffece53e..f7750ac01163f619673a0d03ed0981feca459727 100644 (file)
@@ -81,6 +81,16 @@ public class Refund extends CommonBase {
                return ret;
        }
 
+       /**
+        * Whether the refund has expired given the duration since the Unix epoch.
+        */
+       public boolean is_expired_no_std(long duration_since_epoch) {
+               boolean ret = bindings.Refund_is_expired_no_std(this.ptr, duration_since_epoch);
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(duration_since_epoch);
+               return ret;
+       }
+
        /**
         * The issuer of the refund, possibly beginning with `user@domain` or `domain`. Intended to be
         * displayed to the user but with the caveat that it has not been verified in any way.
@@ -198,6 +208,18 @@ public class Refund extends CommonBase {
                return ret_hu_conv;
        }
 
+       /**
+        * Generates a non-cryptographic 64-bit hash of the Refund.
+        */
+       public long hash() {
+               long ret = bindings.Refund_hash(this.ptr);
+               Reference.reachabilityFence(this);
+               return ret;
+       }
+
+       @Override public int hashCode() {
+               return (int)this.hash();
+       }
        /**
         * Serialize the Refund object into a byte array which can be read by Refund_read
         */