1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
7 import java.lang.ref.Reference;
8 import javax.annotation.Nullable;
12 * An error occurring when converting from [`Script`] to [`ShutdownScript`].
14 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
15 public class InvalidShutdownScript extends CommonBase {
16 InvalidShutdownScript(Object _dummy, long ptr) { super(ptr); }
17 @Override @SuppressWarnings("deprecation")
18 protected void finalize() throws Throwable {
20 if (ptr != 0) { bindings.InvalidShutdownScript_free(ptr); }
24 * The script that did not meet the requirements from [BOLT #2].
26 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
28 public byte[] get_script() {
29 byte[] ret = bindings.InvalidShutdownScript_get_script(this.ptr);
30 Reference.reachabilityFence(this);
35 * The script that did not meet the requirements from [BOLT #2].
37 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
39 public void set_script(byte[] val) {
40 bindings.InvalidShutdownScript_set_script(this.ptr, val);
41 Reference.reachabilityFence(this);
42 Reference.reachabilityFence(val);
46 * Constructs a new InvalidShutdownScript given each field
48 public static InvalidShutdownScript of(byte[] script_arg) {
49 long ret = bindings.InvalidShutdownScript_new(script_arg);
50 Reference.reachabilityFence(script_arg);
51 if (ret >= 0 && ret <= 4096) { return null; }
52 org.ldk.structs.InvalidShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvalidShutdownScript(null, ret); }
53 ret_hu_conv.ptrs_to.add(ret_hu_conv);
58 long ret = bindings.InvalidShutdownScript_clone_ptr(this.ptr);
59 Reference.reachabilityFence(this);
64 * Creates a copy of the InvalidShutdownScript
66 public InvalidShutdownScript clone() {
67 long ret = bindings.InvalidShutdownScript_clone(this.ptr);
68 Reference.reachabilityFence(this);
69 if (ret >= 0 && ret <= 4096) { return null; }
70 org.ldk.structs.InvalidShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvalidShutdownScript(null, ret); }
71 ret_hu_conv.ptrs_to.add(this);