Update auto-generated bindings to 0.0.103
[ldk-java] / src / main / java / org / ldk / structs / Fallback.java
index de5495fe8ac77cef74b544a84b642acec820f04f..3e687e7cf17d912704d3a02ec783016639beead1 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -61,18 +62,59 @@ public class Fallback extends CommonBase {
         */
        public Fallback clone() {
                long ret = bindings.Fallback_clone(this.ptr);
+               if (ret >= 0 && ret <= 4096) { return null; }
                Fallback ret_hu_conv = Fallback.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }
 
+       /**
+        * Utility method to constructs a new SegWitProgram-variant Fallback
+        */
+       public static Fallback seg_wit_program(UInt5 version, byte[] program) {
+               long ret = bindings.Fallback_seg_wit_program(version.getVal(), program);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               Fallback ret_hu_conv = Fallback.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new PubKeyHash-variant Fallback
+        */
+       public static Fallback pub_key_hash(byte[] a) {
+               long ret = bindings.Fallback_pub_key_hash(a);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               Fallback ret_hu_conv = Fallback.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new ScriptHash-variant Fallback
+        */
+       public static Fallback script_hash(byte[] a) {
+               long ret = bindings.Fallback_script_hash(a);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               Fallback ret_hu_conv = Fallback.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Checks if two Fallbacks contain equal inner contents.
+        */
+       public long hash() {
+               long ret = bindings.Fallback_hash(this.ptr);
+               return ret;
+       }
+
        /**
         * Checks if two Fallbacks contain equal inner contents.
         * This ignores pointers and is_owned flags and looks at the values in fields.
         */
        public boolean eq(Fallback b) {
                boolean ret = bindings.Fallback_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
-               this.ptrs_to.add(b);
                return ret;
        }