X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FOutPoint.java;h=74af3416719026f74c7abdd711fd914a1a705fdf;hb=76b59fb93494e68d9b02d204c9ed9a153c73dd9b;hp=aabd0d231c9658843fb1246ea2bed967e057494a;hpb=166ff04616cfee975ce991607ca0df88857193df;p=ldk-java diff --git a/src/main/java/org/ldk/structs/OutPoint.java b/src/main/java/org/ldk/structs/OutPoint.java index aabd0d23..74af3416 100644 --- a/src/main/java/org/ldk/structs/OutPoint.java +++ b/src/main/java/org/ldk/structs/OutPoint.java @@ -2,43 +2,47 @@ 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 OutPoint extends CommonBase { OutPoint(Object _dummy, long ptr) { super(ptr); } @Override @SuppressWarnings("deprecation") protected void finalize() throws Throwable { - bindings.OutPoint_free(ptr); super.finalize(); + super.finalize(); + if (ptr != 0) { bindings.OutPoint_free(ptr); } } - public OutPoint(OutPoint orig) { - super(bindings.OutPoint_clone(orig.ptr & ~1)); - this.ptrs_to.add(orig); + public static OutPoint constructor_clone(OutPoint orig) { + long ret = bindings.OutPoint_clone(orig == null ? 0 : orig.ptr & ~1); + OutPoint ret_hu_conv = new OutPoint(null, ret); + ret_hu_conv.ptrs_to.add(orig); + return ret_hu_conv; } - public byte[] get_txid(OutPoint this_ptr) { - byte[] ret = bindings.OutPoint_get_txid(this_ptr.ptr & ~1); - this.ptrs_to.add(this_ptr); + public byte[] get_txid() { + byte[] ret = bindings.OutPoint_get_txid(this.ptr); return ret; } - public void set_txid(OutPoint this_ptr, byte[] val) { - bindings.OutPoint_set_txid(this_ptr.ptr & ~1, val); - this.ptrs_to.add(this_ptr); + public void set_txid(byte[] val) { + bindings.OutPoint_set_txid(this.ptr, val); } - public short get_index(OutPoint this_ptr) { - short ret = bindings.OutPoint_get_index(this_ptr.ptr & ~1); - this.ptrs_to.add(this_ptr); + public short get_index() { + short ret = bindings.OutPoint_get_index(this.ptr); return ret; } - public void set_index(OutPoint this_ptr, short val) { - bindings.OutPoint_set_index(this_ptr.ptr & ~1, val); - this.ptrs_to.add(this_ptr); + public void set_index(short val) { + bindings.OutPoint_set_index(this.ptr, val); } - public OutPoint(byte[] txid_arg, short index_arg) { - super(bindings.OutPoint_new(txid_arg, index_arg)); + public static OutPoint constructor_new(byte[] txid_arg, short index_arg) { + long ret = bindings.OutPoint_new(txid_arg, index_arg); + OutPoint ret_hu_conv = new OutPoint(null, ret); + return ret_hu_conv; } public byte[] to_channel_id() { @@ -46,9 +50,16 @@ public class OutPoint extends CommonBase { return ret; } - // Skipped OutPoint_write - public OutPoint(byte[] ser) { - super(bindings.OutPoint_read(ser)); + public byte[] write(OutPoint obj) { + byte[] ret = bindings.OutPoint_write(obj == null ? 0 : obj.ptr & ~1); + this.ptrs_to.add(obj); + return ret; + } + + public static OutPoint constructor_read(byte[] ser) { + long ret = bindings.OutPoint_read(ser); + OutPoint ret_hu_conv = new OutPoint(null, ret); + return ret_hu_conv; } }