// Path: src/org/sagemath/droid/constants/ExecutionState.java
// public class ExecutionState {
//     public static final int ERROR = 0x000300;
//     public static final int IDLE = 0x000301;
//     public static final int BUSY = 0x000302;
//     public static final int DEAD = 0x000303;
//     public static final int OK = 0x000304;
// }
// 
// Path: src/org/sagemath/droid/constants/MessageType.java
// public class MessageType {
//     public static final int ERROR = 0x000100;
//     public static final int PYOUT = 0x000101;
//     public static final int PYIN = 0x000102;
//     public static final int STATUS = 0x000103;
//     public static final int DISPLAY_DATA = 0x000104;
//     public static final int STREAM = 0x000105;
//     public static final int PYERR = 0x000106;
//     public static final int EXECUTE_REQUEST = 0x000107;
//     public static final int EXECUTE_REPLY = 0x000108;
//     public static final int HTML_FILES = 0x000109;
//     public static final int INTERACT_PREPARE = 0x000110;
//     public static final int EXTENSION = 0x000111;
//     public static final int TEXT_FILENAME = 0x000112;
//     public static final int IMAGE_FILENAME = 0x000113;
//     public static final int INTERACT = 0x000114;
//     public static final int SAGE_CLEAR = 0x000115;
// }


import android.util.Log;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import org.sagemath.droid.constants.ExecutionState;
import org.sagemath.droid.constants.MessageType;
import org.sagemath.droid.deserializers.*;
    }

    public void setJsonData(String jsonData) {
        this.jsonData = jsonData;
    }

    //---UTILITY METHODS---

    public boolean isReplyTo(Request request) {
        return (request != null) && getHeader().getSession().equals(request.getHeader().getSession());
    }

    public String toString() {
        return gson.toJson(this);
    }

    public static BaseReply parse(String jsonString) throws Exception {
        Gson gson = new GsonBuilder()
                .registerTypeAdapter(BaseReply.class, new BaseReplyDeserializer())
                .registerTypeAdapter(InteractReply.InteractContent.class, new InteractContentDeserializer())
                .registerTypeAdapter(InteractReply.InteractData.class, new InteractDataDeserializer())
                .registerTypeAdapter(InteractReply.SageInteract.class, new SageInteractDeserializer())
                .registerTypeAdapter(Values.class, new ValueDeserializer())
                .create();

        //Return the appropriate BaseReply
        BaseReply baseReply = gson.fromJson(jsonString, BaseReply.class);

        reply = baseReply;
        switch (baseReply.getMessageType()) {
// Path: src/org/sagemath/droid/constants/ExecutionState.java
// public class ExecutionState {
//     public static final int ERROR = 0x000300;
//     public static final int IDLE = 0x000301;
//     public static final int BUSY = 0x000302;
//     public static final int DEAD = 0x000303;
//     public static final int OK = 0x000304;
// }
// 
// Path: src/org/sagemath/droid/constants/MessageType.java
// public class MessageType {
//     public static final int ERROR = 0x000100;
//     public static final int PYOUT = 0x000101;
//     public static final int PYIN = 0x000102;
//     public static final int STATUS = 0x000103;
//     public static final int DISPLAY_DATA = 0x000104;
//     public static final int STREAM = 0x000105;
//     public static final int PYERR = 0x000106;
//     public static final int EXECUTE_REQUEST = 0x000107;
//     public static final int EXECUTE_REPLY = 0x000108;
//     public static final int HTML_FILES = 0x000109;
//     public static final int INTERACT_PREPARE = 0x000110;
//     public static final int EXTENSION = 0x000111;
//     public static final int TEXT_FILENAME = 0x000112;
//     public static final int IMAGE_FILENAME = 0x000113;
//     public static final int INTERACT = 0x000114;
//     public static final int SAGE_CLEAR = 0x000115;
// }


// Path: src/org/sagemath/droid/models/gson/BaseReply.java
import android.util.Log;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import org.sagemath.droid.constants.ExecutionState;
import org.sagemath.droid.constants.MessageType;
import org.sagemath.droid.deserializers.*;

    }

    public void setJsonData(String jsonData) {
        this.jsonData = jsonData;
    }

    //---UTILITY METHODS---

    public boolean isReplyTo(Request request) {
        return (request != null) && getHeader().getSession().equals(request.getHeader().getSession());
    }

    public String toString() {
        return gson.toJson(this);
    }

    public static BaseReply parse(String jsonString) throws Exception {
        Gson gson = new GsonBuilder()
                .registerTypeAdapter(BaseReply.class, new BaseReplyDeserializer())
                .registerTypeAdapter(InteractReply.InteractContent.class, new InteractContentDeserializer())
                .registerTypeAdapter(InteractReply.InteractData.class, new InteractDataDeserializer())
                .registerTypeAdapter(InteractReply.SageInteract.class, new SageInteractDeserializer())
                .registerTypeAdapter(Values.class, new ValueDeserializer())
                .create();

        //Return the appropriate BaseReply
        BaseReply baseReply = gson.fromJson(jsonString, BaseReply.class);

        reply = baseReply;
        switch (baseReply.getMessageType()) {
            case MessageType.PYIN: