[Java] Update auto-generated bindings to LDK 0.0.123
[ldk-java] / src / main / java / org / ldk / structs / TxRemoveInput.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 tx_remove_input message for removing an input during interactive transaction construction.
13  */
14 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
15 public class TxRemoveInput extends CommonBase {
16         TxRemoveInput(Object _dummy, long ptr) { super(ptr); }
17         @Override @SuppressWarnings("deprecation")
18         protected void finalize() throws Throwable {
19                 super.finalize();
20                 if (ptr != 0) { bindings.TxRemoveInput_free(ptr); }
21         }
22
23         /**
24          * The channel ID
25          */
26         public ChannelId get_channel_id() {
27                 long ret = bindings.TxRemoveInput_get_channel_id(this.ptr);
28                 Reference.reachabilityFence(this);
29                 if (ret >= 0 && ret <= 4096) { return null; }
30                 org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); }
31                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
32                 return ret_hu_conv;
33         }
34
35         /**
36          * The channel ID
37          */
38         public void set_channel_id(org.ldk.structs.ChannelId val) {
39                 bindings.TxRemoveInput_set_channel_id(this.ptr, val.ptr);
40                 Reference.reachabilityFence(this);
41                 Reference.reachabilityFence(val);
42                 if (this != null) { this.ptrs_to.add(val); };
43         }
44
45         /**
46          * The serial ID of the input to be removed
47          */
48         public long get_serial_id() {
49                 long ret = bindings.TxRemoveInput_get_serial_id(this.ptr);
50                 Reference.reachabilityFence(this);
51                 return ret;
52         }
53
54         /**
55          * The serial ID of the input to be removed
56          */
57         public void set_serial_id(long val) {
58                 bindings.TxRemoveInput_set_serial_id(this.ptr, val);
59                 Reference.reachabilityFence(this);
60                 Reference.reachabilityFence(val);
61         }
62
63         /**
64          * Constructs a new TxRemoveInput given each field
65          */
66         public static TxRemoveInput of(org.ldk.structs.ChannelId channel_id_arg, long serial_id_arg) {
67                 long ret = bindings.TxRemoveInput_new(channel_id_arg.ptr, serial_id_arg);
68                 Reference.reachabilityFence(channel_id_arg);
69                 Reference.reachabilityFence(serial_id_arg);
70                 if (ret >= 0 && ret <= 4096) { return null; }
71                 org.ldk.structs.TxRemoveInput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxRemoveInput(null, ret); }
72                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
73                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id_arg); };
74                 return ret_hu_conv;
75         }
76
77         long clone_ptr() {
78                 long ret = bindings.TxRemoveInput_clone_ptr(this.ptr);
79                 Reference.reachabilityFence(this);
80                 return ret;
81         }
82
83         /**
84          * Creates a copy of the TxRemoveInput
85          */
86         public TxRemoveInput clone() {
87                 long ret = bindings.TxRemoveInput_clone(this.ptr);
88                 Reference.reachabilityFence(this);
89                 if (ret >= 0 && ret <= 4096) { return null; }
90                 org.ldk.structs.TxRemoveInput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxRemoveInput(null, ret); }
91                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
92                 return ret_hu_conv;
93         }
94
95         /**
96          * Generates a non-cryptographic 64-bit hash of the TxRemoveInput.
97          */
98         public long hash() {
99                 long ret = bindings.TxRemoveInput_hash(this.ptr);
100                 Reference.reachabilityFence(this);
101                 return ret;
102         }
103
104         @Override public int hashCode() {
105                 return (int)this.hash();
106         }
107         /**
108          * Checks if two TxRemoveInputs contain equal inner contents.
109          * This ignores pointers and is_owned flags and looks at the values in fields.
110          * Two objects with NULL inner values will be considered "equal" here.
111          */
112         public boolean eq(org.ldk.structs.TxRemoveInput b) {
113                 boolean ret = bindings.TxRemoveInput_eq(this.ptr, b.ptr);
114                 Reference.reachabilityFence(this);
115                 Reference.reachabilityFence(b);
116                 if (this != null) { this.ptrs_to.add(b); };
117                 return ret;
118         }
119
120         @Override public boolean equals(Object o) {
121                 if (!(o instanceof TxRemoveInput)) return false;
122                 return this.eq((TxRemoveInput)o);
123         }
124         /**
125          * Serialize the TxRemoveInput object into a byte array which can be read by TxRemoveInput_read
126          */
127         public byte[] write() {
128                 byte[] ret = bindings.TxRemoveInput_write(this.ptr);
129                 Reference.reachabilityFence(this);
130                 return ret;
131         }
132
133         /**
134          * Read a TxRemoveInput from a byte array, created by TxRemoveInput_write
135          */
136         public static Result_TxRemoveInputDecodeErrorZ read(byte[] ser) {
137                 long ret = bindings.TxRemoveInput_read(ser);
138                 Reference.reachabilityFence(ser);
139                 if (ret >= 0 && ret <= 4096) { return null; }
140                 Result_TxRemoveInputDecodeErrorZ ret_hu_conv = Result_TxRemoveInputDecodeErrorZ.constr_from_ptr(ret);
141                 return ret_hu_conv;
142         }
143
144 }