]> git.bitcoin.ninja Git - ldk-java/blob - src/main/java/org/ldk/structs/ChannelReestablish.java
[Java] Update auto-generated Java bindings
[ldk-java] / src / main / java / org / ldk / structs / ChannelReestablish.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 import java.lang.ref.Reference;
8 import javax.annotation.Nullable;
9
10
11 /**
12  * A channel_reestablish message to be sent or received from a peer
13  */
14 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
15 public class ChannelReestablish extends CommonBase {
16         ChannelReestablish(Object _dummy, long ptr) { super(ptr); }
17         @Override @SuppressWarnings("deprecation")
18         protected void finalize() throws Throwable {
19                 super.finalize();
20                 if (ptr != 0) { bindings.ChannelReestablish_free(ptr); }
21         }
22
23         /**
24          * The channel ID
25          */
26         public byte[] get_channel_id() {
27                 byte[] ret = bindings.ChannelReestablish_get_channel_id(this.ptr);
28                 Reference.reachabilityFence(this);
29                 return ret;
30         }
31
32         /**
33          * The channel ID
34          */
35         public void set_channel_id(byte[] val) {
36                 bindings.ChannelReestablish_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
37                 Reference.reachabilityFence(this);
38                 Reference.reachabilityFence(val);
39         }
40
41         /**
42          * The next commitment number for the sender
43          */
44         public long get_next_local_commitment_number() {
45                 long ret = bindings.ChannelReestablish_get_next_local_commitment_number(this.ptr);
46                 Reference.reachabilityFence(this);
47                 return ret;
48         }
49
50         /**
51          * The next commitment number for the sender
52          */
53         public void set_next_local_commitment_number(long val) {
54                 bindings.ChannelReestablish_set_next_local_commitment_number(this.ptr, val);
55                 Reference.reachabilityFence(this);
56                 Reference.reachabilityFence(val);
57         }
58
59         /**
60          * The next commitment number for the recipient
61          */
62         public long get_next_remote_commitment_number() {
63                 long ret = bindings.ChannelReestablish_get_next_remote_commitment_number(this.ptr);
64                 Reference.reachabilityFence(this);
65                 return ret;
66         }
67
68         /**
69          * The next commitment number for the recipient
70          */
71         public void set_next_remote_commitment_number(long val) {
72                 bindings.ChannelReestablish_set_next_remote_commitment_number(this.ptr, val);
73                 Reference.reachabilityFence(this);
74                 Reference.reachabilityFence(val);
75         }
76
77         long clone_ptr() {
78                 long ret = bindings.ChannelReestablish_clone_ptr(this.ptr);
79                 Reference.reachabilityFence(this);
80                 return ret;
81         }
82
83         /**
84          * Creates a copy of the ChannelReestablish
85          */
86         public ChannelReestablish clone() {
87                 long ret = bindings.ChannelReestablish_clone(this.ptr);
88                 Reference.reachabilityFence(this);
89                 if (ret >= 0 && ret <= 4096) { return null; }
90                 org.ldk.structs.ChannelReestablish ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelReestablish(null, ret); }
91                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
92                 return ret_hu_conv;
93         }
94
95         /**
96          * Checks if two ChannelReestablishs contain equal inner contents.
97          * This ignores pointers and is_owned flags and looks at the values in fields.
98          * Two objects with NULL inner values will be considered "equal" here.
99          */
100         public boolean eq(ChannelReestablish b) {
101                 boolean ret = bindings.ChannelReestablish_eq(this.ptr, b == null ? 0 : b.ptr);
102                 Reference.reachabilityFence(this);
103                 Reference.reachabilityFence(b);
104                 if (this != null) { this.ptrs_to.add(b); };
105                 return ret;
106         }
107
108         @Override public boolean equals(Object o) {
109                 if (!(o instanceof ChannelReestablish)) return false;
110                 return this.eq((ChannelReestablish)o);
111         }
112         /**
113          * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
114          */
115         public byte[] write() {
116                 byte[] ret = bindings.ChannelReestablish_write(this.ptr);
117                 Reference.reachabilityFence(this);
118                 return ret;
119         }
120
121         /**
122          * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
123          */
124         public static Result_ChannelReestablishDecodeErrorZ read(byte[] ser) {
125                 long ret = bindings.ChannelReestablish_read(ser);
126                 Reference.reachabilityFence(ser);
127                 if (ret >= 0 && ret <= 4096) { return null; }
128                 Result_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret);
129                 return ret_hu_conv;
130         }
131
132 }