[TS] Update auto-generated bindings to LDK-C-Bindings 0.0.123.1
[ldk-java] / src / main / java / org / ldk / structs / SocketAddress.java
index c074f68f129534ed01a3a1b6370ae8534829dcdd..0582f9ff8fb2529dc15d2b98572748643b9d4ef4 100644 (file)
@@ -215,7 +215,7 @@ public class SocketAddress extends CommonBase {
         * Utility method to constructs a new Hostname-variant SocketAddress
         */
        public static SocketAddress hostname(org.ldk.structs.Hostname hostname, short port) {
-               long ret = bindings.SocketAddress_hostname(hostname == null ? 0 : hostname.ptr, port);
+               long ret = bindings.SocketAddress_hostname(hostname.ptr, port);
                Reference.reachabilityFence(hostname);
                Reference.reachabilityFence(port);
                if (ret >= 0 && ret <= 4096) { return null; }
@@ -225,12 +225,24 @@ public class SocketAddress extends CommonBase {
                return ret_hu_conv;
        }
 
+       /**
+        * Generates a non-cryptographic 64-bit hash of the SocketAddress.
+        */
+       public long hash() {
+               long ret = bindings.SocketAddress_hash(this.ptr);
+               Reference.reachabilityFence(this);
+               return ret;
+       }
+
+       @Override public int hashCode() {
+               return (int)this.hash();
+       }
        /**
         * Checks if two SocketAddresss contain equal inner contents.
         * This ignores pointers and is_owned flags and looks at the values in fields.
         */
        public boolean eq(org.ldk.structs.SocketAddress b) {
-               boolean ret = bindings.SocketAddress_eq(this.ptr, b == null ? 0 : b.ptr);
+               boolean ret = bindings.SocketAddress_eq(this.ptr, b.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(b);
                return ret;