Package com.tinkerpop.rexster.protocol.serializer.json.templates

Source Code of com.tinkerpop.rexster.protocol.serializer.json.templates.BindingsTemplate

package com.tinkerpop.rexster.protocol.serializer.json.templates;

import com.tinkerpop.rexster.protocol.msg.RexProBindings;
import org.codehaus.jackson.JsonNode;

import java.util.Map;

/**
* @author Blake Eggleston (bdeggleston.github.com)
*/
public class BindingsTemplate implements JsonTemplate<RexProBindings> {
    @Override
    public RexProBindings deserialize(JsonNode json) {
        return new RexProBindings((Map<String, Object>) JsonConverter.fromJsonNode(json));
    }

    @Override
    public JsonNode serialize(RexProBindings src) {
        return JsonConverter.toJsonNode(src);
    }


    public static BindingsTemplate instance = new BindingsTemplate();
    static public BindingsTemplate getInstance() {
        return instance;
    }
}
TOP

Related Classes of com.tinkerpop.rexster.protocol.serializer.json.templates.BindingsTemplate

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.