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

org.dflib.jjava.jupyter.messages.request.InspectRequest Maven / Gradle / Ivy

The newest version!
package org.dflib.jjava.jupyter.messages.request;

import com.google.gson.annotations.SerializedName;
import org.dflib.jjava.jupyter.messages.ContentType;
import org.dflib.jjava.jupyter.messages.MessageType;
import org.dflib.jjava.jupyter.messages.RequestType;
import org.dflib.jjava.jupyter.messages.reply.InspectReply;

public class InspectRequest implements ContentType, RequestType {
    public static final MessageType MESSAGE_TYPE = MessageType.INSPECT_REQUEST;
    public static final MessageType REPLY_MESSAGE_TYPE = MessageType.INSPECT_REPLY;

    @Override
    public MessageType getType() {
        return MESSAGE_TYPE;
    }

    @Override
    public MessageType getReplyType() {
        return REPLY_MESSAGE_TYPE;
    }

    /**
     * The code that the request wants inspected
     */
    protected final String code;

    /**
     * The character index within the code in which the cursor is
     * at. This allows for an inspection
     */
    @SerializedName("cursor_pos")
    protected final int cursorPos;

    /**
     * Either 0 or 1. 0 is the default and in IPython level 1
     * includes the source in the inspection.
     */
    @SerializedName("detail_level")
    protected final int detailLevel;

    public InspectRequest(String code, int cursorPos, int detailLevel) {
        this.code = code;
        this.cursorPos = cursorPos;
        this.detailLevel = detailLevel;
    }

    public String getCode() {
        return code;
    }

    public int getCursorPos() {
        return cursorPos;
    }

    public int getDetailLevel() {
        return detailLevel;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy