Update auto-updated Java files
[ldk-java] / src / main / java / org / ldk / structs / PrivateRoute.java
index c4f11b6c8983fd035f0a4b9fa497d9de3630db4b..060e8b166b36c6635d8b7b8aea22aadeaed30b76 100644 (file)
@@ -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;
 
 
@@ -24,6 +25,7 @@ public class PrivateRoute extends CommonBase {
 
        long clone_ptr() {
                long ret = bindings.PrivateRoute_clone_ptr(this.ptr);
+               Reference.reachabilityFence(this);
                return ret;
        }
 
@@ -32,6 +34,7 @@ public class PrivateRoute extends CommonBase {
         */
        public PrivateRoute clone() {
                long ret = bindings.PrivateRoute_clone(this.ptr);
+               Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
                PrivateRoute ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PrivateRoute(null, ret); }
                ret_hu_conv.ptrs_to.add(this);
@@ -43,9 +46,13 @@ public class PrivateRoute extends CommonBase {
         */
        public long hash() {
                long ret = bindings.PrivateRoute_hash(this.ptr);
+               Reference.reachabilityFence(this);
                return ret;
        }
 
+       @Override public int hashCode() {
+               return (int)this.hash();
+       }
        /**
         * Checks if two PrivateRoutes contain equal inner contents.
         * This ignores pointers and is_owned flags and looks at the values in fields.
@@ -53,15 +60,22 @@ public class PrivateRoute extends CommonBase {
         */
        public boolean eq(PrivateRoute b) {
                boolean ret = bindings.PrivateRoute_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 PrivateRoute)) return false;
+               return this.eq((PrivateRoute)o);
+       }
        /**
         * Creates a new (partial) route from a list of hops
         */
        public static Result_PrivateRouteCreationErrorZ of(RouteHint hops) {
                long ret = bindings.PrivateRoute_new(hops == null ? 0 : hops.ptr & ~1);
+               Reference.reachabilityFence(hops);
                if (ret >= 0 && ret <= 4096) { return null; }
                Result_PrivateRouteCreationErrorZ ret_hu_conv = Result_PrivateRouteCreationErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
@@ -72,6 +86,7 @@ public class PrivateRoute extends CommonBase {
         */
        public RouteHint into_inner() {
                long ret = bindings.PrivateRoute_into_inner(this.ptr);
+               Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
                RouteHint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RouteHint(null, ret); }
                ret_hu_conv.ptrs_to.add(this);