+ ptr = 0;
+ }
+ public static interface OnionMessageContentsInterface {
+ /**
+ * Returns the TLV type identifying the message contents. MUST be >= 64.
+ */
+ long tlv_type();
+ /**
+ * Serialize the object into a byte array
+ */
+ byte[] write();
+ /**
+ * Return a human-readable "debug" string describing this object
+ */
+ String debug_str();
+ }
+ private static class LDKOnionMessageContentsHolder { OnionMessageContents held; }
+ public static OnionMessageContents new_impl(OnionMessageContentsInterface arg) {
+ final LDKOnionMessageContentsHolder impl_holder = new LDKOnionMessageContentsHolder();
+ impl_holder.held = new OnionMessageContents(new bindings.LDKOnionMessageContents() {
+ @Override public long tlv_type() {
+ long ret = arg.tlv_type();
+ Reference.reachabilityFence(arg);
+ return ret;
+ }
+ @Override public byte[] write() {
+ byte[] ret = arg.write();
+ Reference.reachabilityFence(arg);
+ return ret;
+ }
+ @Override public String debug_str() {
+ String ret = arg.debug_str();
+ Reference.reachabilityFence(arg);
+ return ret;
+ }
+ });
+ return impl_holder.held;