a22d021b2fe6fa6c53de5416805c9770ce57c097
[ldk-java] / src / main / java / org / ldk / structs / UserConfig.java
1 package org.ldk.structs;
2
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
5
6 public class UserConfig extends CommonBase {
7         UserConfig(Object _dummy, long ptr) { super(ptr); }
8         @Override @SuppressWarnings("deprecation")
9         protected void finalize() throws Throwable {
10                 bindings.UserConfig_free(ptr); super.finalize();
11         }
12
13         public UserConfig(UserConfig orig) {
14                 super(bindings.UserConfig_clone(orig == null ? 0 : orig.ptr & ~1));
15                 this.ptrs_to.add(orig);
16         }
17
18         public ChannelHandshakeConfig get_own_channel_config(UserConfig this_ptr) {
19                 ChannelHandshakeConfig ret = new ChannelHandshakeConfig(null, bindings.UserConfig_get_own_channel_config(this_ptr == null ? 0 : this_ptr.ptr & ~1));
20                 this.ptrs_to.add(this_ptr);
21                 return ret;
22         }
23
24         public void set_own_channel_config(UserConfig this_ptr, ChannelHandshakeConfig val) {
25                 bindings.UserConfig_set_own_channel_config(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1);
26                 this.ptrs_to.add(this_ptr);
27                 this.ptrs_to.add(val);
28         }
29
30         public ChannelHandshakeLimits get_peer_channel_config_limits(UserConfig this_ptr) {
31                 ChannelHandshakeLimits ret = new ChannelHandshakeLimits(null, bindings.UserConfig_get_peer_channel_config_limits(this_ptr == null ? 0 : this_ptr.ptr & ~1));
32                 this.ptrs_to.add(this_ptr);
33                 return ret;
34         }
35
36         public void set_peer_channel_config_limits(UserConfig this_ptr, ChannelHandshakeLimits val) {
37                 bindings.UserConfig_set_peer_channel_config_limits(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1);
38                 this.ptrs_to.add(this_ptr);
39                 this.ptrs_to.add(val);
40         }
41
42         public ChannelConfig get_channel_options(UserConfig this_ptr) {
43                 ChannelConfig ret = new ChannelConfig(null, bindings.UserConfig_get_channel_options(this_ptr == null ? 0 : this_ptr.ptr & ~1));
44                 this.ptrs_to.add(this_ptr);
45                 return ret;
46         }
47
48         public void set_channel_options(UserConfig this_ptr, ChannelConfig val) {
49                 bindings.UserConfig_set_channel_options(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1);
50                 this.ptrs_to.add(this_ptr);
51                 this.ptrs_to.add(val);
52         }
53
54         public UserConfig(ChannelHandshakeConfig own_channel_config_arg, ChannelHandshakeLimits peer_channel_config_limits_arg, ChannelConfig channel_options_arg) {
55                 super(bindings.UserConfig_new(own_channel_config_arg == null ? 0 : own_channel_config_arg.ptr & ~1, peer_channel_config_limits_arg == null ? 0 : peer_channel_config_limits_arg.ptr & ~1, channel_options_arg == null ? 0 : channel_options_arg.ptr & ~1));
56                 this.ptrs_to.add(own_channel_config_arg);
57                 this.ptrs_to.add(peer_channel_config_limits_arg);
58                 this.ptrs_to.add(channel_options_arg);
59         }
60
61         public UserConfig() {
62                 super(bindings.UserConfig_default());
63         }
64
65 }