// Path: driver/src/com/leandog/brazenhead/commands/Command.java
// public enum Target {
//     LastResultOrRobotium, Robotium, Brazenhead,
// }


import java.lang.reflect.Type;
import com.google.brazenhead.gson.*;
import com.leandog.brazenhead.commands.*;
import com.leandog.brazenhead.commands.Command.Target;
package com.leandog.brazenhead.json;



public class CommandDeserializer implements JsonDeserializer<Command> {

    @Override
    public Command deserialize(JsonElement json, Type type, JsonDeserializationContext context) throws JsonParseException {
        JsonObject jsonObject = (JsonObject) json;
        Command command = new Command(getName(jsonObject), getArguments(jsonObject, context));
        command.setVariable(getVariable(jsonObject));
        command.setTarget(getTarget(jsonObject, context));
        return command;
    }

    private String getVariable(JsonObject jsonObject) {
        JsonElement variable = jsonObject.get("variable");
        return (variable != null) ? variable.getAsString() : null;
    }

// Path: driver/src/com/leandog/brazenhead/commands/Command.java
// public enum Target {
//     LastResultOrRobotium, Robotium, Brazenhead,
// }


// Path: driver/src/com/leandog/brazenhead/json/CommandDeserializer.java
import java.lang.reflect.Type;
import com.google.brazenhead.gson.*;
import com.leandog.brazenhead.commands.*;
import com.leandog.brazenhead.commands.Command.Target;

package com.leandog.brazenhead.json;



public class CommandDeserializer implements JsonDeserializer<Command> {

    @Override
    public Command deserialize(JsonElement json, Type type, JsonDeserializationContext context) throws JsonParseException {
        JsonObject jsonObject = (JsonObject) json;
        Command command = new Command(getName(jsonObject), getArguments(jsonObject, context));
        command.setVariable(getVariable(jsonObject));
        command.setTarget(getTarget(jsonObject, context));
        return command;
    }

    private String getVariable(JsonObject jsonObject) {
        JsonElement variable = jsonObject.get("variable");
        return (variable != null) ? variable.getAsString() : null;
    }

    private Target getTarget(JsonObject jsonObject, JsonDeserializationContext context) {