c16675d551439d5b8c5b89b84e5d2a93422a6909
[ldk-java] / ts / structs / ChannelUpdate.ts
1
2 import CommonBase from './CommonBase';
3 import * as bindings from '../bindings' // TODO: figure out location
4
5 public class ChannelUpdate extends CommonBase {
6         ChannelUpdate(Object _dummy, long ptr) { super(ptr); }
7         @Override @SuppressWarnings("deprecation")
8         protected void finalize() throws Throwable {
9                 super.finalize();
10                 if (ptr != 0) { bindings.ChannelUpdate_free(ptr); }
11         }
12
13         public ChannelUpdate clone() {
14                 uint32_t ret = bindings.ChannelUpdate_clone(this.ptr);
15                 ChannelUpdate ret_hu_conv = new ChannelUpdate(null, ret);
16                 return ret_hu_conv;
17         }
18
19         public byte[] get_signature() {
20                 byte[] ret = bindings.ChannelUpdate_get_signature(this.ptr);
21                 return ret;
22         }
23
24         public void set_signature(byte[] val) {
25                 bindings.ChannelUpdate_set_signature(this.ptr, val);
26         }
27
28         public UnsignedChannelUpdate get_contents() {
29                 uint32_t ret = bindings.ChannelUpdate_get_contents(this.ptr);
30                 UnsignedChannelUpdate ret_hu_conv = new UnsignedChannelUpdate(null, ret);
31                 return ret_hu_conv;
32         }
33
34         public void set_contents(UnsignedChannelUpdate val) {
35                 bindings.ChannelUpdate_set_contents(this.ptr, val == null ? 0 : val.ptr & ~1);
36                 this.ptrs_to.add(val);
37         }
38
39         public static ChannelUpdate constructor_new(byte[] signature_arg, UnsignedChannelUpdate contents_arg) {
40                 uint32_t ret = bindings.ChannelUpdate_new(signature_arg, contents_arg == null ? 0 : contents_arg.ptr & ~1);
41                 ChannelUpdate ret_hu_conv = new ChannelUpdate(null, ret);
42                 ret_hu_conv.ptrs_to.add(contents_arg);
43                 return ret_hu_conv;
44         }
45
46         public byte[] write() {
47                 byte[] ret = bindings.ChannelUpdate_write(this.ptr);
48                 return ret;
49         }
50
51         public static ChannelUpdate constructor_read(byte[] ser) {
52                 uint32_t ret = bindings.ChannelUpdate_read(ser);
53                 ChannelUpdate ret_hu_conv = new ChannelUpdate(null, ret);
54                 return ret_hu_conv;
55         }
56
57 }