2409134c233e4b4932e16c193b0339e74ea98159
[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 static ChannelUpdate constructor_clone(ChannelUpdate orig) {
18                 long ret = bindings.ChannelUpdate_clone(orig == null ? 0 : orig.ptr & ~1);
19                 ChannelUpdate ret_hu_conv = new ChannelUpdate(null, ret);
20                 ret_hu_conv.ptrs_to.add(orig);
21                 return ret_hu_conv;
22         }
23
24         public byte[] get_signature() {
25                 byte[] ret = bindings.ChannelUpdate_get_signature(this.ptr);
26                 return ret;
27         }
28
29         public void set_signature(byte[] val) {
30                 bindings.ChannelUpdate_set_signature(this.ptr, val);
31         }
32
33         public UnsignedChannelUpdate get_contents() {
34                 long ret = bindings.ChannelUpdate_get_contents(this.ptr);
35                 UnsignedChannelUpdate ret_hu_conv = new UnsignedChannelUpdate(null, ret);
36                 return ret_hu_conv;
37         }
38
39         public void set_contents(UnsignedChannelUpdate val) {
40                 bindings.ChannelUpdate_set_contents(this.ptr, val == null ? 0 : val.ptr & ~1);
41                 this.ptrs_to.add(val);
42         }
43
44         public static ChannelUpdate constructor_new(byte[] signature_arg, UnsignedChannelUpdate contents_arg) {
45                 long ret = bindings.ChannelUpdate_new(signature_arg, contents_arg == null ? 0 : contents_arg.ptr & ~1);
46                 ChannelUpdate ret_hu_conv = new ChannelUpdate(null, ret);
47                 ret_hu_conv.ptrs_to.add(contents_arg);
48                 return ret_hu_conv;
49         }
50
51         public byte[] write(ChannelUpdate obj) {
52                 byte[] ret = bindings.ChannelUpdate_write(obj == null ? 0 : obj.ptr & ~1);
53                 this.ptrs_to.add(obj);
54                 return ret;
55         }
56
57         public static ChannelUpdate constructor_read(byte[] ser) {
58                 long ret = bindings.ChannelUpdate_read(ser);
59                 ChannelUpdate ret_hu_conv = new ChannelUpdate(null, ret);
60                 return ret_hu_conv;
61         }
62
63 }