Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / InvalidShutdownScript.java
1 package org.ldk.structs;
2
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
5 import org.ldk.util.*;
6 import java.util.Arrays;
7 import javax.annotation.Nullable;
8
9
10 /**
11  * An error occurring when converting from [`Script`] to [`ShutdownScript`].
12  */
13 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
14 public class InvalidShutdownScript extends CommonBase {
15         InvalidShutdownScript(Object _dummy, long ptr) { super(ptr); }
16         @Override @SuppressWarnings("deprecation")
17         protected void finalize() throws Throwable {
18                 super.finalize();
19                 if (ptr != 0) { bindings.InvalidShutdownScript_free(ptr); }
20         }
21
22         /**
23          * The script that did not meet the requirements from [BOLT #2].
24          * 
25          * [BOLT #2]: https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md
26          */
27         public byte[] get_script() {
28                 byte[] ret = bindings.InvalidShutdownScript_get_script(this.ptr);
29                 return ret;
30         }
31
32         /**
33          * The script that did not meet the requirements from [BOLT #2].
34          * 
35          * [BOLT #2]: https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md
36          */
37         public void set_script(byte[] val) {
38                 bindings.InvalidShutdownScript_set_script(this.ptr, val);
39         }
40
41         /**
42          * Constructs a new InvalidShutdownScript given each field
43          */
44         public static InvalidShutdownScript of(byte[] script_arg) {
45                 long ret = bindings.InvalidShutdownScript_new(script_arg);
46                 if (ret >= 0 && ret <= 4096) { return null; }
47                 InvalidShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvalidShutdownScript(null, ret); }
48                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
49                 return ret_hu_conv;
50         }
51
52         long clone_ptr() {
53                 long ret = bindings.InvalidShutdownScript_clone_ptr(this.ptr);
54                 return ret;
55         }
56
57         /**
58          * Creates a copy of the InvalidShutdownScript
59          */
60         public InvalidShutdownScript clone() {
61                 long ret = bindings.InvalidShutdownScript_clone(this.ptr);
62                 if (ret >= 0 && ret <= 4096) { return null; }
63                 InvalidShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvalidShutdownScript(null, ret); }
64                 ret_hu_conv.ptrs_to.add(this);
65                 return ret_hu_conv;
66         }
67
68 }