1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
8 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
9 public class UnsignedChannelAnnouncement extends CommonBase {
10 UnsignedChannelAnnouncement(Object _dummy, long ptr) { super(ptr); }
11 @Override @SuppressWarnings("deprecation")
12 protected void finalize() throws Throwable {
14 if (ptr != 0) { bindings.UnsignedChannelAnnouncement_free(ptr); }
17 public UnsignedChannelAnnouncement clone() {
18 long ret = bindings.UnsignedChannelAnnouncement_clone(this.ptr);
19 UnsignedChannelAnnouncement ret_hu_conv = new UnsignedChannelAnnouncement(null, ret);
20 ret_hu_conv.ptrs_to.add(this);
24 public ChannelFeatures get_features() {
25 long ret = bindings.UnsignedChannelAnnouncement_get_features(this.ptr);
26 ChannelFeatures ret_hu_conv = new ChannelFeatures(null, ret);
27 ret_hu_conv.ptrs_to.add(this);
31 public void set_features(ChannelFeatures val) {
32 bindings.UnsignedChannelAnnouncement_set_features(this.ptr, val == null ? 0 : val.ptr & ~1);
33 this.ptrs_to.add(val);
34 // Due to rust's strict-ownership memory model, in some cases we need to "move"
35 // an object to pass exclusive ownership to the function being called.
36 // In most cases, we avoid this being visible in GC'd languages by cloning the object
37 // at the FFI layer, creating a new object which Rust can claim ownership of
38 // However, in some cases (eg here), there is no way to clone an object, and thus
39 // we actually have to pass full ownership to Rust.
40 // Thus, after this call, val is reset to null and is now a dummy object.
44 public byte[] get_chain_hash() {
45 byte[] ret = bindings.UnsignedChannelAnnouncement_get_chain_hash(this.ptr);
49 public void set_chain_hash(byte[] val) {
50 bindings.UnsignedChannelAnnouncement_set_chain_hash(this.ptr, val);
53 public long get_short_channel_id() {
54 long ret = bindings.UnsignedChannelAnnouncement_get_short_channel_id(this.ptr);
58 public void set_short_channel_id(long val) {
59 bindings.UnsignedChannelAnnouncement_set_short_channel_id(this.ptr, val);
62 public byte[] get_node_id_1() {
63 byte[] ret = bindings.UnsignedChannelAnnouncement_get_node_id_1(this.ptr);
67 public void set_node_id_1(byte[] val) {
68 bindings.UnsignedChannelAnnouncement_set_node_id_1(this.ptr, val);
71 public byte[] get_node_id_2() {
72 byte[] ret = bindings.UnsignedChannelAnnouncement_get_node_id_2(this.ptr);
76 public void set_node_id_2(byte[] val) {
77 bindings.UnsignedChannelAnnouncement_set_node_id_2(this.ptr, val);
80 public byte[] get_bitcoin_key_1() {
81 byte[] ret = bindings.UnsignedChannelAnnouncement_get_bitcoin_key_1(this.ptr);
85 public void set_bitcoin_key_1(byte[] val) {
86 bindings.UnsignedChannelAnnouncement_set_bitcoin_key_1(this.ptr, val);
89 public byte[] get_bitcoin_key_2() {
90 byte[] ret = bindings.UnsignedChannelAnnouncement_get_bitcoin_key_2(this.ptr);
94 public void set_bitcoin_key_2(byte[] val) {
95 bindings.UnsignedChannelAnnouncement_set_bitcoin_key_2(this.ptr, val);
98 public byte[] write() {
99 byte[] ret = bindings.UnsignedChannelAnnouncement_write(this.ptr);
103 public static Result_UnsignedChannelAnnouncementDecodeErrorZ constructor_read(byte[] ser) {
104 long ret = bindings.UnsignedChannelAnnouncement_read(ser);
105 Result_UnsignedChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret);