import org.ldk.impl.bindings;
import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
public class RoutingFees extends CommonBase {
RoutingFees(Object _dummy, long ptr) { super(ptr); }
@Override @SuppressWarnings("deprecation")
protected void finalize() throws Throwable {
- bindings.RoutingFees_free(ptr); super.finalize();
+ super.finalize();
+ if (ptr != 0) { bindings.RoutingFees_free(ptr); }
}
- public RoutingFees(RoutingFees orig) {
- super(bindings.RoutingFees_clone(orig == null ? 0 : orig.ptr & ~1));
- this.ptrs_to.add(orig);
+ public RoutingFees clone() {
+ long ret = bindings.RoutingFees_clone(this.ptr);
+ RoutingFees ret_hu_conv = new RoutingFees(null, ret);
+ return ret_hu_conv;
}
- public int get_base_msat(RoutingFees this_ptr) {
- int ret = bindings.RoutingFees_get_base_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1);
- this.ptrs_to.add(this_ptr);
+ public int get_base_msat() {
+ int ret = bindings.RoutingFees_get_base_msat(this.ptr);
return ret;
}
- public void set_base_msat(RoutingFees this_ptr, int val) {
- bindings.RoutingFees_set_base_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
- this.ptrs_to.add(this_ptr);
+ public void set_base_msat(int val) {
+ bindings.RoutingFees_set_base_msat(this.ptr, val);
}
- public int get_proportional_millionths(RoutingFees this_ptr) {
- int ret = bindings.RoutingFees_get_proportional_millionths(this_ptr == null ? 0 : this_ptr.ptr & ~1);
- this.ptrs_to.add(this_ptr);
+ public int get_proportional_millionths() {
+ int ret = bindings.RoutingFees_get_proportional_millionths(this.ptr);
return ret;
}
- public void set_proportional_millionths(RoutingFees this_ptr, int val) {
- bindings.RoutingFees_set_proportional_millionths(this_ptr == null ? 0 : this_ptr.ptr & ~1, val);
- this.ptrs_to.add(this_ptr);
+ public void set_proportional_millionths(int val) {
+ bindings.RoutingFees_set_proportional_millionths(this.ptr, val);
}
- public RoutingFees(int base_msat_arg, int proportional_millionths_arg) {
- super(bindings.RoutingFees_new(base_msat_arg, proportional_millionths_arg));
+ public static RoutingFees constructor_new(int base_msat_arg, int proportional_millionths_arg) {
+ long ret = bindings.RoutingFees_new(base_msat_arg, proportional_millionths_arg);
+ RoutingFees ret_hu_conv = new RoutingFees(null, ret);
+ return ret_hu_conv;
}
- public RoutingFees(byte[] ser) {
- super(bindings.RoutingFees_read(ser));
+ public static Result_RoutingFeesDecodeErrorZ constructor_read(byte[] ser) {
+ long ret = bindings.RoutingFees_read(ser);
+ Result_RoutingFeesDecodeErrorZ ret_hu_conv = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ public byte[] write() {
+ byte[] ret = bindings.RoutingFees_write(this.ptr);
+ return ret;
}
- // Skipped RoutingFees_write
}