org.rapaio.jupyter.kernel.message.Message Maven / Gradle / Ivy
package org.rapaio.jupyter.kernel.message;
import java.util.Collections;
import java.util.List;
import java.util.Map;
public record Message(
List identities,
Header header,
Header> parentHeader,
Map metadata,
T content,
List blobs) {
public Message(MessageContext> ctx, MessageType type, Map metadata, T content, List blobs) {
this(
ctx != null ? ctx.identities() : Collections.emptyList(),
new Header<>(ctx, type),
ctx != null ? ctx.header() : null,
metadata,
content,
blobs
);
}
public MessageContext getContext() {
return new MessageContext<>(identities, header);
}
}