805b4511cbbbc7fdfa3475bb2f6323c08395d8a0
[ldk-java] / src / main / java / org / ldk / structs / ChannelUpdate.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
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 {
13                 super.finalize();
14                 if (ptr != 0) { bindings.ChannelUpdate_free(ptr); }
15         }
16
17         public byte[] get_signature() {
18                 byte[] ret = bindings.ChannelUpdate_get_signature(this.ptr);
19                 return ret;
20         }
21
22         public void set_signature(byte[] val) {
23                 bindings.ChannelUpdate_set_signature(this.ptr, val);
24         }
25
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);
30                 return ret_hu_conv;
31         }
32
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);
36         }
37
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);
43                 return ret_hu_conv;
44         }
45
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);
50                 return ret_hu_conv;
51         }
52
53         public byte[] write() {
54                 byte[] ret = bindings.ChannelUpdate_write(this.ptr);
55                 return ret;
56         }
57
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);
61                 return ret_hu_conv;
62         }
63
64 }