90f1f4b7bd8ff9599fe6a17a87a5ce457303b25c
[ldk-java] / src / main / java / org / ldk / structs / ChannelInfo.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 ChannelInfo extends CommonBase {
10         ChannelInfo(Object _dummy, long ptr) { super(ptr); }
11         @Override @SuppressWarnings("deprecation")
12         protected void finalize() throws Throwable {
13                 super.finalize();
14                 if (ptr != 0) { bindings.ChannelInfo_free(ptr); }
15         }
16
17         public ChannelFeatures get_features() {
18                 long ret = bindings.ChannelInfo_get_features(this.ptr);
19                 ChannelFeatures ret_hu_conv = new ChannelFeatures(null, ret);
20                 ret_hu_conv.ptrs_to.add(this);
21                 return ret_hu_conv;
22         }
23
24         public void set_features(ChannelFeatures val) {
25                 bindings.ChannelInfo_set_features(this.ptr, val == null ? 0 : val.ptr & ~1);
26                 this.ptrs_to.add(val);
27         }
28
29         public byte[] get_node_one() {
30                 byte[] ret = bindings.ChannelInfo_get_node_one(this.ptr);
31                 return ret;
32         }
33
34         public void set_node_one(byte[] val) {
35                 bindings.ChannelInfo_set_node_one(this.ptr, val);
36         }
37
38         public DirectionalChannelInfo get_one_to_two() {
39                 long ret = bindings.ChannelInfo_get_one_to_two(this.ptr);
40                 DirectionalChannelInfo ret_hu_conv = new DirectionalChannelInfo(null, ret);
41                 ret_hu_conv.ptrs_to.add(this);
42                 return ret_hu_conv;
43         }
44
45         public void set_one_to_two(DirectionalChannelInfo val) {
46                 bindings.ChannelInfo_set_one_to_two(this.ptr, val == null ? 0 : val.ptr & ~1);
47                 this.ptrs_to.add(val);
48         }
49
50         public byte[] get_node_two() {
51                 byte[] ret = bindings.ChannelInfo_get_node_two(this.ptr);
52                 return ret;
53         }
54
55         public void set_node_two(byte[] val) {
56                 bindings.ChannelInfo_set_node_two(this.ptr, val);
57         }
58
59         public DirectionalChannelInfo get_two_to_one() {
60                 long ret = bindings.ChannelInfo_get_two_to_one(this.ptr);
61                 DirectionalChannelInfo ret_hu_conv = new DirectionalChannelInfo(null, ret);
62                 ret_hu_conv.ptrs_to.add(this);
63                 return ret_hu_conv;
64         }
65
66         public void set_two_to_one(DirectionalChannelInfo val) {
67                 bindings.ChannelInfo_set_two_to_one(this.ptr, val == null ? 0 : val.ptr & ~1);
68                 this.ptrs_to.add(val);
69         }
70
71         public ChannelAnnouncement get_announcement_message() {
72                 long ret = bindings.ChannelInfo_get_announcement_message(this.ptr);
73                 ChannelAnnouncement ret_hu_conv = new ChannelAnnouncement(null, ret);
74                 ret_hu_conv.ptrs_to.add(this);
75                 return ret_hu_conv;
76         }
77
78         public void set_announcement_message(ChannelAnnouncement val) {
79                 bindings.ChannelInfo_set_announcement_message(this.ptr, val == null ? 0 : val.ptr & ~1);
80                 this.ptrs_to.add(val);
81         }
82
83         public ChannelInfo clone() {
84                 long ret = bindings.ChannelInfo_clone(this.ptr);
85                 ChannelInfo ret_hu_conv = new ChannelInfo(null, ret);
86                 ret_hu_conv.ptrs_to.add(this);
87                 return ret_hu_conv;
88         }
89
90         public byte[] write() {
91                 byte[] ret = bindings.ChannelInfo_write(this.ptr);
92                 return ret;
93         }
94
95         public static Result_ChannelInfoDecodeErrorZ constructor_read(byte[] ser) {
96                 long ret = bindings.ChannelInfo_read(ser);
97                 Result_ChannelInfoDecodeErrorZ ret_hu_conv = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret);
98                 return ret_hu_conv;
99         }
100
101 }