class JoltTransformer {

    public static Future<JsonObject> transform(String jsonInput, JoltSpec spec) {
        Future<JsonObject> future = Future.future();
        try {
            Chainr chainr = spec.getChainr();
            Object inputJSON = JsonUtils.jsonToObject(jsonInput);
            Object transformedOutput = chainr.transform(inputJSON);
            future.complete(new JsonObject(JsonUtils.toJsonString(transformedOutput)));
        } catch (Exception ex){
            future.fail(ex);
        }
        return future;
    }

}