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 ChannelInfo extends CommonBase {
10 ChannelInfo(Object _dummy, long ptr) { super(ptr); }
11 @Override @SuppressWarnings("deprecation")
12 protected void finalize() throws Throwable {
14 if (ptr != 0) { bindings.ChannelInfo_free(ptr); }
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);
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);
29 public byte[] get_node_one() {
30 byte[] ret = bindings.ChannelInfo_get_node_one(this.ptr);
34 public void set_node_one(byte[] val) {
35 bindings.ChannelInfo_set_node_one(this.ptr, val);
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);
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);
50 public byte[] get_node_two() {
51 byte[] ret = bindings.ChannelInfo_get_node_two(this.ptr);
55 public void set_node_two(byte[] val) {
56 bindings.ChannelInfo_set_node_two(this.ptr, val);
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);
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);
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);
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);
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);
90 public byte[] write() {
91 byte[] ret = bindings.ChannelInfo_write(this.ptr);
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);