[C#] Run tests against release library in determinism CI run
[ldk-java] / src / main / java / org / ldk / structs / UpdateFailMalformedHTLC.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  * An [`update_fail_malformed_htlc`] message to be sent to or received from a peer.
13  * 
14  * [`update_fail_malformed_htlc`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#removing-an-htlc-update_fulfill_htlc-update_fail_htlc-and-update_fail_malformed_htlc
15  */
16 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
17 public class UpdateFailMalformedHTLC extends CommonBase {
18         UpdateFailMalformedHTLC(Object _dummy, long ptr) { super(ptr); }
19         @Override @SuppressWarnings("deprecation")
20         protected void finalize() throws Throwable {
21                 super.finalize();
22                 if (ptr != 0) { bindings.UpdateFailMalformedHTLC_free(ptr); }
23         }
24
25         /**
26          * The channel ID
27          */
28         public ChannelId get_channel_id() {
29                 long ret = bindings.UpdateFailMalformedHTLC_get_channel_id(this.ptr);
30                 Reference.reachabilityFence(this);
31                 if (ret >= 0 && ret <= 4096) { return null; }
32                 org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); }
33                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
34                 return ret_hu_conv;
35         }
36
37         /**
38          * The channel ID
39          */
40         public void set_channel_id(org.ldk.structs.ChannelId val) {
41                 bindings.UpdateFailMalformedHTLC_set_channel_id(this.ptr, val.ptr);
42                 Reference.reachabilityFence(this);
43                 Reference.reachabilityFence(val);
44                 if (this != null) { this.ptrs_to.add(val); };
45         }
46
47         /**
48          * The HTLC ID
49          */
50         public long get_htlc_id() {
51                 long ret = bindings.UpdateFailMalformedHTLC_get_htlc_id(this.ptr);
52                 Reference.reachabilityFence(this);
53                 return ret;
54         }
55
56         /**
57          * The HTLC ID
58          */
59         public void set_htlc_id(long val) {
60                 bindings.UpdateFailMalformedHTLC_set_htlc_id(this.ptr, val);
61                 Reference.reachabilityFence(this);
62                 Reference.reachabilityFence(val);
63         }
64
65         /**
66          * The failure code
67          */
68         public short get_failure_code() {
69                 short ret = bindings.UpdateFailMalformedHTLC_get_failure_code(this.ptr);
70                 Reference.reachabilityFence(this);
71                 return ret;
72         }
73
74         /**
75          * The failure code
76          */
77         public void set_failure_code(short val) {
78                 bindings.UpdateFailMalformedHTLC_set_failure_code(this.ptr, val);
79                 Reference.reachabilityFence(this);
80                 Reference.reachabilityFence(val);
81         }
82
83         long clone_ptr() {
84                 long ret = bindings.UpdateFailMalformedHTLC_clone_ptr(this.ptr);
85                 Reference.reachabilityFence(this);
86                 return ret;
87         }
88
89         /**
90          * Creates a copy of the UpdateFailMalformedHTLC
91          */
92         public UpdateFailMalformedHTLC clone() {
93                 long ret = bindings.UpdateFailMalformedHTLC_clone(this.ptr);
94                 Reference.reachabilityFence(this);
95                 if (ret >= 0 && ret <= 4096) { return null; }
96                 org.ldk.structs.UpdateFailMalformedHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UpdateFailMalformedHTLC(null, ret); }
97                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
98                 return ret_hu_conv;
99         }
100
101         /**
102          * Generates a non-cryptographic 64-bit hash of the UpdateFailMalformedHTLC.
103          */
104         public long hash() {
105                 long ret = bindings.UpdateFailMalformedHTLC_hash(this.ptr);
106                 Reference.reachabilityFence(this);
107                 return ret;
108         }
109
110         @Override public int hashCode() {
111                 return (int)this.hash();
112         }
113         /**
114          * Checks if two UpdateFailMalformedHTLCs contain equal inner contents.
115          * This ignores pointers and is_owned flags and looks at the values in fields.
116          * Two objects with NULL inner values will be considered "equal" here.
117          */
118         public boolean eq(org.ldk.structs.UpdateFailMalformedHTLC b) {
119                 boolean ret = bindings.UpdateFailMalformedHTLC_eq(this.ptr, b.ptr);
120                 Reference.reachabilityFence(this);
121                 Reference.reachabilityFence(b);
122                 if (this != null) { this.ptrs_to.add(b); };
123                 return ret;
124         }
125
126         @Override public boolean equals(Object o) {
127                 if (!(o instanceof UpdateFailMalformedHTLC)) return false;
128                 return this.eq((UpdateFailMalformedHTLC)o);
129         }
130         /**
131          * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
132          */
133         public byte[] write() {
134                 byte[] ret = bindings.UpdateFailMalformedHTLC_write(this.ptr);
135                 Reference.reachabilityFence(this);
136                 return ret;
137         }
138
139         /**
140          * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
141          */
142         public static Result_UpdateFailMalformedHTLCDecodeErrorZ read(byte[] ser) {
143                 long ret = bindings.UpdateFailMalformedHTLC_read(ser);
144                 Reference.reachabilityFence(ser);
145                 if (ret >= 0 && ret <= 4096) { return null; }
146                 Result_UpdateFailMalformedHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailMalformedHTLCDecodeErrorZ.constr_from_ptr(ret);
147                 return ret_hu_conv;
148         }
149
150 }