X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FPong.java;h=ef636e284961a5c9b7684ddc069c2661061b615e;hb=fed2245c60159f6c074c9ed5c0f3ce273ad9841b;hp=fc98b396ae2abd8228c64e706de3cf1e0df9da5b;hpb=166ff04616cfee975ce991607ca0df88857193df;p=ldk-java diff --git a/src/main/java/org/ldk/structs/Pong.java b/src/main/java/org/ldk/structs/Pong.java index fc98b396..ef636e28 100644 --- a/src/main/java/org/ldk/structs/Pong.java +++ b/src/main/java/org/ldk/structs/Pong.java @@ -2,37 +2,50 @@ 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 Pong extends CommonBase { Pong(Object _dummy, long ptr) { super(ptr); } @Override @SuppressWarnings("deprecation") protected void finalize() throws Throwable { - bindings.Pong_free(ptr); super.finalize(); + super.finalize(); + if (ptr != 0) { bindings.Pong_free(ptr); } } - public Pong(Pong orig) { - super(bindings.Pong_clone(orig.ptr & ~1)); - this.ptrs_to.add(orig); + public Pong clone() { + long ret = bindings.Pong_clone(this.ptr); + Pong ret_hu_conv = new Pong(null, ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; } - public short get_byteslen(Pong this_ptr) { - short ret = bindings.Pong_get_byteslen(this_ptr.ptr & ~1); - this.ptrs_to.add(this_ptr); + public short get_byteslen() { + short ret = bindings.Pong_get_byteslen(this.ptr); return ret; } - public void set_byteslen(Pong this_ptr, short val) { - bindings.Pong_set_byteslen(this_ptr.ptr & ~1, val); - this.ptrs_to.add(this_ptr); + public void set_byteslen(short val) { + bindings.Pong_set_byteslen(this.ptr, val); } - public Pong(short byteslen_arg) { - super(bindings.Pong_new(byteslen_arg)); + public static Pong constructor_new(short byteslen_arg) { + long ret = bindings.Pong_new(byteslen_arg); + Pong ret_hu_conv = new Pong(null, ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; } - // Skipped Pong_write - public Pong(byte[] ser) { - super(bindings.Pong_read(ser)); + public byte[] write() { + byte[] ret = bindings.Pong_write(this.ptr); + return ret; + } + + public static Result_PongDecodeErrorZ constructor_read(byte[] ser) { + long ret = bindings.Pong_read(ser); + Result_PongDecodeErrorZ ret_hu_conv = Result_PongDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; } }