Search in sources :

Example 1 with DefaultWeaveRunnableSpecification

use of com.continuuity.weave.internal.DefaultWeaveRunnableSpecification in project weave by continuuity.

the class WeaveRunnableSpecificationCodec method deserialize.

@Override
public WeaveRunnableSpecification deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
    JsonObject jsonObj = json.getAsJsonObject();
    String className = jsonObj.get("classname").getAsString();
    String name = jsonObj.get("name").getAsString();
    Map<String, String> arguments = context.deserialize(jsonObj.get("arguments"), new TypeToken<Map<String, String>>() {
    }.getType());
    return new DefaultWeaveRunnableSpecification(className, name, arguments);
}
Also used : TypeToken(com.google.common.reflect.TypeToken) JsonObject(com.google.gson.JsonObject) DefaultWeaveRunnableSpecification(com.continuuity.weave.internal.DefaultWeaveRunnableSpecification)

Aggregations

DefaultWeaveRunnableSpecification (com.continuuity.weave.internal.DefaultWeaveRunnableSpecification)1 TypeToken (com.google.common.reflect.TypeToken)1 JsonObject (com.google.gson.JsonObject)1