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 ChannelDetails extends CommonBase {
10 ChannelDetails(Object _dummy, long ptr) { super(ptr); }
11 @Override @SuppressWarnings("deprecation")
12 protected void finalize() throws Throwable {
14 if (ptr != 0) { bindings.ChannelDetails_free(ptr); }
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);
24 public byte[] get_channel_id() {
25 byte[] ret = bindings.ChannelDetails_get_channel_id(this.ptr);
29 public void set_channel_id(byte[] val) {
30 bindings.ChannelDetails_set_channel_id(this.ptr, val);
33 public byte[] get_remote_network_id() {
34 byte[] ret = bindings.ChannelDetails_get_remote_network_id(this.ptr);
38 public void set_remote_network_id(byte[] val) {
39 bindings.ChannelDetails_set_remote_network_id(this.ptr, val);
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);
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.
62 public long get_channel_value_satoshis() {
63 long ret = bindings.ChannelDetails_get_channel_value_satoshis(this.ptr);
67 public void set_channel_value_satoshis(long val) {
68 bindings.ChannelDetails_set_channel_value_satoshis(this.ptr, val);
71 public long get_user_id() {
72 long ret = bindings.ChannelDetails_get_user_id(this.ptr);
76 public void set_user_id(long val) {
77 bindings.ChannelDetails_set_user_id(this.ptr, val);
80 public long get_outbound_capacity_msat() {
81 long ret = bindings.ChannelDetails_get_outbound_capacity_msat(this.ptr);
85 public void set_outbound_capacity_msat(long val) {
86 bindings.ChannelDetails_set_outbound_capacity_msat(this.ptr, val);
89 public long get_inbound_capacity_msat() {
90 long ret = bindings.ChannelDetails_get_inbound_capacity_msat(this.ptr);
94 public void set_inbound_capacity_msat(long val) {
95 bindings.ChannelDetails_set_inbound_capacity_msat(this.ptr, val);
98 public boolean get_is_live() {
99 boolean ret = bindings.ChannelDetails_get_is_live(this.ptr);
103 public void set_is_live(boolean val) {
104 bindings.ChannelDetails_set_is_live(this.ptr, val);