Package com.tinkerpop.rexster.protocol.msg

Examples of com.tinkerpop.rexster.protocol.msg.RexProBindings


* @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));
    }
View Full Code Here


    public void write(Packer pk, RexProBindings v) throws IOException {
        write(pk, v, false);
    }

    public void write(final Packer pk, final RexProBindings v, final boolean required) throws IOException {
        RexProBindings bindings = v;
        if (bindings == null) {
            bindings = new RexProBindings();
        }
        pk.writeMapBegin(bindings.size());
        for (Map.Entry pair : bindings.entrySet()) {
            pk.write(pair.getKey());
            try {
                ResultsConverter.serializeObject(pair.getValue(), pk);
            } catch (Exception ex) {
                throw new IOException(ex.toString());
View Full Code Here

    public RexProBindings read(final Unpacker u, final RexProBindings to, final boolean required) throws IOException {
        if (!required && u.trySkipNil()) {
            return null;
        }

        RexProBindings bindings;
        if (to != null) {
            bindings = to;
            bindings.clear();
        } else {
            bindings = new RexProBindings();
        }

        int n = u.readMapBegin();
        for (int i=0; i<n; i++) {
            final String key = u.read(Templates.TString);
            final Object val = ResultsConverter.deserializeObject(u.read(Templates.TValue));
            bindings.put(key, val);
        }
        u.readMapEnd();

        return bindings;
    }
View Full Code Here

TOP

Related Classes of com.tinkerpop.rexster.protocol.msg.RexProBindings

Copyright © 2018 www.massapicom. 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.