All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.rapaio.jupyter.kernel.message.Message Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version
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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy