X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FUnsignedNodeAnnouncement.java;h=8a38275f8633a291ac64d8f063bc6dc5f0d1f932;hb=3c88e2f6e84c7f38723ff162ca72d613df5eeb97;hp=51d93e3522a8e7d890905d692fe0fa849cb70f41;hpb=166ff04616cfee975ce991607ca0df88857193df;p=ldk-java diff --git a/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java b/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java index 51d93e35..8a38275f 100644 --- a/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java +++ b/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java @@ -2,79 +2,83 @@ 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 UnsignedNodeAnnouncement extends CommonBase { UnsignedNodeAnnouncement(Object _dummy, long ptr) { super(ptr); } @Override @SuppressWarnings("deprecation") protected void finalize() throws Throwable { - bindings.UnsignedNodeAnnouncement_free(ptr); super.finalize(); + super.finalize(); + if (ptr != 0) { bindings.UnsignedNodeAnnouncement_free(ptr); } } - public UnsignedNodeAnnouncement(UnsignedNodeAnnouncement orig) { - super(bindings.UnsignedNodeAnnouncement_clone(orig.ptr & ~1)); - this.ptrs_to.add(orig); + public static UnsignedNodeAnnouncement constructor_clone(UnsignedNodeAnnouncement orig) { + long ret = bindings.UnsignedNodeAnnouncement_clone(orig == null ? 0 : orig.ptr & ~1); + UnsignedNodeAnnouncement ret_hu_conv = new UnsignedNodeAnnouncement(null, ret); + ret_hu_conv.ptrs_to.add(orig); + return ret_hu_conv; } - public NodeFeatures get_features(UnsignedNodeAnnouncement this_ptr) { - NodeFeatures ret = new NodeFeatures(null, bindings.UnsignedNodeAnnouncement_get_features(this_ptr.ptr & ~1)); - this.ptrs_to.add(this_ptr); + public NodeFeatures get_features() { + long ret = bindings.UnsignedNodeAnnouncement_get_features(this.ptr); + NodeFeatures ret_hu_conv = new NodeFeatures(null, ret); + return ret_hu_conv; + } + + // Skipped UnsignedNodeAnnouncement_set_features + public int get_timestamp() { + int ret = bindings.UnsignedNodeAnnouncement_get_timestamp(this.ptr); return ret; } - public void set_features(UnsignedNodeAnnouncement this_ptr, NodeFeatures val) { - bindings.UnsignedNodeAnnouncement_set_features(this_ptr.ptr & ~1, val.ptr & ~1); - this.ptrs_to.add(this_ptr); - this.ptrs_to.add(val); + public void set_timestamp(int val) { + bindings.UnsignedNodeAnnouncement_set_timestamp(this.ptr, val); } - public int get_timestamp(UnsignedNodeAnnouncement this_ptr) { - int ret = bindings.UnsignedNodeAnnouncement_get_timestamp(this_ptr.ptr & ~1); - this.ptrs_to.add(this_ptr); + public byte[] get_node_id() { + byte[] ret = bindings.UnsignedNodeAnnouncement_get_node_id(this.ptr); return ret; } - public void set_timestamp(UnsignedNodeAnnouncement this_ptr, int val) { - bindings.UnsignedNodeAnnouncement_set_timestamp(this_ptr.ptr & ~1, val); - this.ptrs_to.add(this_ptr); + public void set_node_id(byte[] val) { + bindings.UnsignedNodeAnnouncement_set_node_id(this.ptr, val); } - public byte[] get_node_id(UnsignedNodeAnnouncement this_ptr) { - byte[] ret = bindings.UnsignedNodeAnnouncement_get_node_id(this_ptr.ptr & ~1); - this.ptrs_to.add(this_ptr); + public byte[] get_rgb() { + byte[] ret = bindings.UnsignedNodeAnnouncement_get_rgb(this.ptr); return ret; } - public void set_node_id(UnsignedNodeAnnouncement this_ptr, byte[] val) { - bindings.UnsignedNodeAnnouncement_set_node_id(this_ptr.ptr & ~1, val); - this.ptrs_to.add(this_ptr); + public void set_rgb(byte[] val) { + bindings.UnsignedNodeAnnouncement_set_rgb(this.ptr, val); } - public byte[] get_rgb(UnsignedNodeAnnouncement this_ptr) { - byte[] ret = bindings.UnsignedNodeAnnouncement_get_rgb(this_ptr.ptr & ~1); - this.ptrs_to.add(this_ptr); + public byte[] get_alias() { + byte[] ret = bindings.UnsignedNodeAnnouncement_get_alias(this.ptr); return ret; } - public void set_rgb(UnsignedNodeAnnouncement this_ptr, byte[] val) { - bindings.UnsignedNodeAnnouncement_set_rgb(this_ptr.ptr & ~1, val); - this.ptrs_to.add(this_ptr); + public void set_alias(byte[] val) { + bindings.UnsignedNodeAnnouncement_set_alias(this.ptr, val); } - public byte[] get_alias(UnsignedNodeAnnouncement this_ptr) { - byte[] ret = bindings.UnsignedNodeAnnouncement_get_alias(this_ptr.ptr & ~1); - this.ptrs_to.add(this_ptr); - return ret; + public void set_addresses(NetAddress[] val) { + bindings.UnsignedNodeAnnouncement_set_addresses(this.ptr, Arrays.stream(val).mapToLong(arr_conv_12 -> arr_conv_12.ptr).toArray()); + /* TODO 2 NetAddress */; } - public void set_alias(UnsignedNodeAnnouncement this_ptr, byte[] val) { - bindings.UnsignedNodeAnnouncement_set_alias(this_ptr.ptr & ~1, val); - this.ptrs_to.add(this_ptr); + public byte[] write(UnsignedNodeAnnouncement obj) { + byte[] ret = bindings.UnsignedNodeAnnouncement_write(obj == null ? 0 : obj.ptr & ~1); + this.ptrs_to.add(obj); + return ret; } - // Skipped UnsignedNodeAnnouncement_set_addresses - // Skipped UnsignedNodeAnnouncement_write - public UnsignedNodeAnnouncement(byte[] ser) { - super(bindings.UnsignedNodeAnnouncement_read(ser)); + public static UnsignedNodeAnnouncement constructor_read(byte[] ser) { + long ret = bindings.UnsignedNodeAnnouncement_read(ser); + UnsignedNodeAnnouncement ret_hu_conv = new UnsignedNodeAnnouncement(null, ret); + return ret_hu_conv; } }