X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FHTLCUpdate.java;h=2f5fb3e3ce4db56c860c3fae849c121fb0c1e664;hb=76b59fb93494e68d9b02d204c9ed9a153c73dd9b;hp=c8751fd35b51296315e741f6201115a28e4fa9b5;hpb=ad15b3a4dbf3fbc7f08ef22d656bae79e8182008;p=ldk-java diff --git a/src/main/java/org/ldk/structs/HTLCUpdate.java b/src/main/java/org/ldk/structs/HTLCUpdate.java index c8751fd3..2f5fb3e3 100644 --- a/src/main/java/org/ldk/structs/HTLCUpdate.java +++ b/src/main/java/org/ldk/structs/HTLCUpdate.java @@ -2,23 +2,35 @@ package org.ldk.structs; 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 HTLCUpdate extends CommonBase { HTLCUpdate(Object _dummy, long ptr) { super(ptr); } @Override @SuppressWarnings("deprecation") protected void finalize() throws Throwable { super.finalize(); - bindings.HTLCUpdate_free(ptr); + if (ptr != 0) { bindings.HTLCUpdate_free(ptr); } } - public HTLCUpdate(HTLCUpdate orig) { - super(bindings.HTLCUpdate_clone(orig == null ? 0 : orig.ptr & ~1)); - this.ptrs_to.add(orig); + public static HTLCUpdate constructor_clone(HTLCUpdate orig) { + long ret = bindings.HTLCUpdate_clone(orig == null ? 0 : orig.ptr & ~1); + HTLCUpdate ret_hu_conv = new HTLCUpdate(null, ret); + ret_hu_conv.ptrs_to.add(orig); + return ret_hu_conv; } - // Skipped HTLCUpdate_write - public HTLCUpdate(byte[] ser) { - super(bindings.HTLCUpdate_read(ser)); + public byte[] write(HTLCUpdate obj) { + byte[] ret = bindings.HTLCUpdate_write(obj == null ? 0 : obj.ptr & ~1); + this.ptrs_to.add(obj); + return ret; + } + + public static HTLCUpdate constructor_read(byte[] ser) { + long ret = bindings.HTLCUpdate_read(ser); + HTLCUpdate ret_hu_conv = new HTLCUpdate(null, ret); + return ret_hu_conv; } }