1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
8 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
9 public class ChannelUpdate extends CommonBase {
10 ChannelUpdate(Object _dummy, long ptr) { super(ptr); }
11 @Override @SuppressWarnings("deprecation")
12 protected void finalize() throws Throwable {
14 if (ptr != 0) { bindings.ChannelUpdate_free(ptr); }
17 public byte[] get_signature() {
18 byte[] ret = bindings.ChannelUpdate_get_signature(this.ptr);
22 public void set_signature(byte[] val) {
23 bindings.ChannelUpdate_set_signature(this.ptr, val);
26 public UnsignedChannelUpdate get_contents() {
27 long ret = bindings.ChannelUpdate_get_contents(this.ptr);
28 UnsignedChannelUpdate ret_hu_conv = new UnsignedChannelUpdate(null, ret);
29 ret_hu_conv.ptrs_to.add(this);
33 public void set_contents(UnsignedChannelUpdate val) {
34 bindings.ChannelUpdate_set_contents(this.ptr, val == null ? 0 : val.ptr & ~1);
35 this.ptrs_to.add(val);
38 public static ChannelUpdate constructor_new(byte[] signature_arg, UnsignedChannelUpdate contents_arg) {
39 long ret = bindings.ChannelUpdate_new(signature_arg, contents_arg == null ? 0 : contents_arg.ptr & ~1);
40 ChannelUpdate ret_hu_conv = new ChannelUpdate(null, ret);
41 ret_hu_conv.ptrs_to.add(ret_hu_conv);
42 ret_hu_conv.ptrs_to.add(contents_arg);
46 public ChannelUpdate clone() {
47 long ret = bindings.ChannelUpdate_clone(this.ptr);
48 ChannelUpdate ret_hu_conv = new ChannelUpdate(null, ret);
49 ret_hu_conv.ptrs_to.add(this);
53 public byte[] write() {
54 byte[] ret = bindings.ChannelUpdate_write(this.ptr);
58 public static Result_ChannelUpdateDecodeErrorZ constructor_read(byte[] ser) {
59 long ret = bindings.ChannelUpdate_read(ser);
60 Result_ChannelUpdateDecodeErrorZ ret_hu_conv = Result_ChannelUpdateDecodeErrorZ.constr_from_ptr(ret);