[Java] Update auto-generated Java bindings to LDK 0.0.121
[ldk-java] / src / main / java / org / ldk / structs / ShutdownScript.java
index bbb3da38c99cc9664d734963475fd82b1d5ec4a1..4a422d0619e0f9e3c7fe382587d853a9a00773a6 100644 (file)
@@ -36,10 +36,27 @@ public class ShutdownScript extends CommonBase {
                Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.ShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ShutdownScript(null, ret); }
-               ret_hu_conv.ptrs_to.add(this);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
                return ret_hu_conv;
        }
 
+       /**
+        * Checks if two ShutdownScripts contain equal inner contents.
+        * 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(org.ldk.structs.ShutdownScript b) {
+               boolean ret = bindings.ShutdownScript_eq(this.ptr, b == null ? 0 : b.ptr);
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(b);
+               if (this != null) { this.ptrs_to.add(b); };
+               return ret;
+       }
+
+       @Override public boolean equals(Object o) {
+               if (!(o instanceof ShutdownScript)) return false;
+               return this.eq((ShutdownScript)o);
+       }
        /**
         * Serialize the ShutdownScript object into a byte array which can be read by ShutdownScript_read
         */
@@ -68,7 +85,7 @@ public class ShutdownScript extends CommonBase {
                Reference.reachabilityFence(pubkey_hash);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.ShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ShutdownScript(null, ret); }
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
                return ret_hu_conv;
        }
 
@@ -80,7 +97,7 @@ public class ShutdownScript extends CommonBase {
                Reference.reachabilityFence(script_hash);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.ShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ShutdownScript(null, ret); }
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
                return ret_hu_conv;
        }
 
@@ -94,22 +111,21 @@ public class ShutdownScript extends CommonBase {
         * 
         * This function may return an error if `program` is invalid for the segwit `version`.
         */
-       public static Result_ShutdownScriptInvalidShutdownScriptZ new_witness_program(WitnessVersion version, byte[] program) {
-               long ret = bindings.ShutdownScript_new_witness_program(version.getVal(), program);
-               Reference.reachabilityFence(version);
-               Reference.reachabilityFence(program);
+       public static Result_ShutdownScriptInvalidShutdownScriptZ new_witness_program(org.ldk.structs.WitnessProgram witness_program) {
+               long ret = bindings.ShutdownScript_new_witness_program(witness_program.ptr);
+               Reference.reachabilityFence(witness_program);
                if (ret >= 0 && ret <= 4096) { return null; }
                Result_ShutdownScriptInvalidShutdownScriptZ ret_hu_conv = Result_ShutdownScriptInvalidShutdownScriptZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
 
        /**
-        * Converts the shutdown script into the underlying [`Script`].
+        * Converts the shutdown script into the underlying [`ScriptBuf`].
         */
        public byte[] into_inner() {
                byte[] ret = bindings.ShutdownScript_into_inner(this.ptr);
                Reference.reachabilityFence(this);
-               this.ptrs_to.add(this);
+               if (this != null) { this.ptrs_to.add(this); };
                return ret;
        }
 
@@ -130,11 +146,11 @@ public class ShutdownScript extends CommonBase {
         * 
         * Specifically, checks for compliance with feature `option_shutdown_anysegwit`.
         */
-       public boolean is_compatible(InitFeatures features) {
+       public boolean is_compatible(org.ldk.structs.InitFeatures features) {
                boolean ret = bindings.ShutdownScript_is_compatible(this.ptr, features == null ? 0 : features.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(features);
-               this.ptrs_to.add(features);
+               if (this != null) { this.ptrs_to.add(features); };
                return ret;
        }