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 BroadcasterInterface extends CommonBase {
10 final bindings.LDKBroadcasterInterface bindings_instance;
11 BroadcasterInterface(Object _dummy, long ptr) { super(ptr); bindings_instance = null; }
12 private BroadcasterInterface(bindings.LDKBroadcasterInterface arg) {
13 super(bindings.LDKBroadcasterInterface_new(arg));
14 this.ptrs_to.add(arg);
15 this.bindings_instance = arg;
17 @Override @SuppressWarnings("deprecation")
18 protected void finalize() throws Throwable {
19 if (ptr != 0) { bindings.BroadcasterInterface_free(ptr); } super.finalize();
22 public static interface BroadcasterInterfaceInterface {
23 void broadcast_transaction(byte[] tx);
25 private static class LDKBroadcasterInterfaceHolder { BroadcasterInterface held; }
26 public static BroadcasterInterface new_impl(BroadcasterInterfaceInterface arg) {
27 final LDKBroadcasterInterfaceHolder impl_holder = new LDKBroadcasterInterfaceHolder();
28 impl_holder.held = new BroadcasterInterface(new bindings.LDKBroadcasterInterface() {
29 @Override public void broadcast_transaction(byte[] tx) {
30 arg.broadcast_transaction(tx);
33 return impl_holder.held;
35 public void broadcast_transaction(byte[] tx) {
36 bindings.BroadcasterInterface_broadcast_transaction(this.ptr, tx);