6 namespace org { namespace ldk { namespace structs {
9 * The contents of a custom onion message.
11 public class CustomOnionMessageContents : CommonBase {
12 internal readonly bindings.LDKCustomOnionMessageContents bindings_instance;
13 internal CustomOnionMessageContents(object _dummy, long ptr) : base(ptr) { bindings_instance = null; }
14 private CustomOnionMessageContents(bindings.LDKCustomOnionMessageContents arg) : base(bindings.LDKCustomOnionMessageContents_new(arg)) {
15 this.ptrs_to.AddLast(arg);
16 this.bindings_instance = arg;
18 ~CustomOnionMessageContents() {
19 if (ptr != 0) { bindings.CustomOnionMessageContents_free(ptr); }
22 public interface CustomOnionMessageContentsInterface {
24 * Returns the TLV type identifying the message contents. MUST be >= 64.
28 * Serialize the object into a byte array
32 private class LDKCustomOnionMessageContentsHolder { internal CustomOnionMessageContents held; }
33 private class LDKCustomOnionMessageContentsImpl : bindings.LDKCustomOnionMessageContents {
34 internal LDKCustomOnionMessageContentsImpl(CustomOnionMessageContentsInterface arg, LDKCustomOnionMessageContentsHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; }
35 private CustomOnionMessageContentsInterface arg;
36 private LDKCustomOnionMessageContentsHolder impl_holder;
37 public long tlv_type() {
38 long ret = arg.tlv_type();
42 public byte[] write() {
43 byte[] ret = arg.write();
48 public static CustomOnionMessageContents new_impl(CustomOnionMessageContentsInterface arg) {
49 LDKCustomOnionMessageContentsHolder impl_holder = new LDKCustomOnionMessageContentsHolder();
50 impl_holder.held = new CustomOnionMessageContents(new LDKCustomOnionMessageContentsImpl(arg, impl_holder));
51 return impl_holder.held;
54 * Returns the TLV type identifying the message contents. MUST be >= 64.
56 public long tlv_type() {
57 long ret = bindings.CustomOnionMessageContents_tlv_type(this.ptr);
63 * Serialize the object into a byte array
65 public byte[] write() {
66 byte[] ret = bindings.CustomOnionMessageContents_write(this.ptr);
71 internal long clone_ptr() {
72 long ret = bindings.CustomOnionMessageContents_clone_ptr(this.ptr);
78 * Creates a copy of a CustomOnionMessageContents
80 public CustomOnionMessageContents clone() {
81 long ret = bindings.CustomOnionMessageContents_clone(this.ptr);
83 if (ret >= 0 && ret <= 4096) { return null; }
84 CustomOnionMessageContents ret_hu_conv = new CustomOnionMessageContents(null, ret);
85 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };