Use AutoCloseable for structs named Locked*
[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                 super.finalize();
11                 bindings.UserConfig_free(ptr);
12         }
13
14         public UserConfig(UserConfig orig) {
15                 super(bindings.UserConfig_clone(orig == null ? 0 : orig.ptr & ~1));
16                 this.ptrs_to.add(orig);
17         }
18
19         public ChannelHandshakeConfig get_own_channel_config(UserConfig this_ptr) {
20                 ChannelHandshakeConfig ret = new ChannelHandshakeConfig(null, bindings.UserConfig_get_own_channel_config(this_ptr == null ? 0 : this_ptr.ptr & ~1));
21                 this.ptrs_to.add(this_ptr);
22                 return ret;
23         }
24
25         public void set_own_channel_config(UserConfig this_ptr, ChannelHandshakeConfig val) {
26                 bindings.UserConfig_set_own_channel_config(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1);
27                 this.ptrs_to.add(this_ptr);
28                 this.ptrs_to.add(val);
29         }
30
31         public ChannelHandshakeLimits get_peer_channel_config_limits(UserConfig this_ptr) {
32                 ChannelHandshakeLimits ret = new ChannelHandshakeLimits(null, bindings.UserConfig_get_peer_channel_config_limits(this_ptr == null ? 0 : this_ptr.ptr & ~1));
33                 this.ptrs_to.add(this_ptr);
34                 return ret;
35         }
36
37         public void set_peer_channel_config_limits(UserConfig this_ptr, ChannelHandshakeLimits val) {
38                 bindings.UserConfig_set_peer_channel_config_limits(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1);
39                 this.ptrs_to.add(this_ptr);
40                 this.ptrs_to.add(val);
41         }
42
43         public ChannelConfig get_channel_options(UserConfig this_ptr) {
44                 ChannelConfig ret = new ChannelConfig(null, bindings.UserConfig_get_channel_options(this_ptr == null ? 0 : this_ptr.ptr & ~1));
45                 this.ptrs_to.add(this_ptr);
46                 return ret;
47         }
48
49         public void set_channel_options(UserConfig this_ptr, ChannelConfig val) {
50                 bindings.UserConfig_set_channel_options(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1);
51                 this.ptrs_to.add(this_ptr);
52                 this.ptrs_to.add(val);
53         }
54
55         public UserConfig(ChannelHandshakeConfig own_channel_config_arg, ChannelHandshakeLimits peer_channel_config_limits_arg, ChannelConfig channel_options_arg) {
56                 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));
57                 this.ptrs_to.add(own_channel_config_arg);
58                 this.ptrs_to.add(peer_channel_config_limits_arg);
59                 this.ptrs_to.add(channel_options_arg);
60         }
61
62         public UserConfig() {
63                 super(bindings.UserConfig_default());
64         }
65
66 }