Bindings updates
[ldk-java] / src / main / java / org / ldk / structs / ChannelDetails.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 ChannelDetails extends CommonBase {
10         ChannelDetails(Object _dummy, long ptr) { super(ptr); }
11         @Override @SuppressWarnings("deprecation")
12         protected void finalize() throws Throwable {
13                 super.finalize();
14                 if (ptr != 0) { bindings.ChannelDetails_free(ptr); }
15         }
16
17         public ChannelDetails clone() {
18                 long ret = bindings.ChannelDetails_clone(this.ptr);
19                 ChannelDetails ret_hu_conv = new ChannelDetails(null, ret);
20                 ret_hu_conv.ptrs_to.add(this);
21                 return ret_hu_conv;
22         }
23
24         public byte[] get_channel_id() {
25                 byte[] ret = bindings.ChannelDetails_get_channel_id(this.ptr);
26                 return ret;
27         }
28
29         public void set_channel_id(byte[] val) {
30                 bindings.ChannelDetails_set_channel_id(this.ptr, val);
31         }
32
33         public byte[] get_remote_network_id() {
34                 byte[] ret = bindings.ChannelDetails_get_remote_network_id(this.ptr);
35                 return ret;
36         }
37
38         public void set_remote_network_id(byte[] val) {
39                 bindings.ChannelDetails_set_remote_network_id(this.ptr, val);
40         }
41
42         public InitFeatures get_counterparty_features() {
43                 long ret = bindings.ChannelDetails_get_counterparty_features(this.ptr);
44                 InitFeatures ret_hu_conv = new InitFeatures(null, ret);
45                 ret_hu_conv.ptrs_to.add(this);
46                 return ret_hu_conv;
47         }
48
49         public void set_counterparty_features(InitFeatures val) {
50                 bindings.ChannelDetails_set_counterparty_features(this.ptr, val == null ? 0 : val.ptr & ~1);
51                 this.ptrs_to.add(val);
52                 // Due to rust's strict-ownership memory model, in some cases we need to "move"
53                 // an object to pass exclusive ownership to the function being called.
54                 // In most cases, we avoid this being visible in GC'd languages by cloning the object
55                 // at the FFI layer, creating a new object which Rust can claim ownership of
56                 // However, in some cases (eg here), there is no way to clone an object, and thus
57                 // we actually have to pass full ownership to Rust.
58                 // Thus, after this call, val is reset to null and is now a dummy object.
59                 val.ptr = 0;
60         }
61
62         public long get_channel_value_satoshis() {
63                 long ret = bindings.ChannelDetails_get_channel_value_satoshis(this.ptr);
64                 return ret;
65         }
66
67         public void set_channel_value_satoshis(long val) {
68                 bindings.ChannelDetails_set_channel_value_satoshis(this.ptr, val);
69         }
70
71         public long get_user_id() {
72                 long ret = bindings.ChannelDetails_get_user_id(this.ptr);
73                 return ret;
74         }
75
76         public void set_user_id(long val) {
77                 bindings.ChannelDetails_set_user_id(this.ptr, val);
78         }
79
80         public long get_outbound_capacity_msat() {
81                 long ret = bindings.ChannelDetails_get_outbound_capacity_msat(this.ptr);
82                 return ret;
83         }
84
85         public void set_outbound_capacity_msat(long val) {
86                 bindings.ChannelDetails_set_outbound_capacity_msat(this.ptr, val);
87         }
88
89         public long get_inbound_capacity_msat() {
90                 long ret = bindings.ChannelDetails_get_inbound_capacity_msat(this.ptr);
91                 return ret;
92         }
93
94         public void set_inbound_capacity_msat(long val) {
95                 bindings.ChannelDetails_set_inbound_capacity_msat(this.ptr, val);
96         }
97
98         public boolean get_is_live() {
99                 boolean ret = bindings.ChannelDetails_get_is_live(this.ptr);
100                 return ret;
101         }
102
103         public void set_is_live(boolean val) {
104                 bindings.ChannelDetails_set_is_live(this.ptr, val);
105         }
106
107 }