Package com.tinkerpop.rexster.protocol.msg

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


*/
public class MetaTemplate implements JsonTemplate<RexProMessageMeta> {

    @Override
    public RexProMessageMeta deserialize(JsonNode json) {
        RexProMessageMeta meta = new RexProMessageMeta();
        Iterator<String> itr = json.getFieldNames();
        while (itr.hasNext()) {
            String key = itr.next();
            JsonNode val = json.get(key);
            meta.put(key, JsonConverter.fromJsonNode(val));
        }
        return meta;
    }
View Full Code Here


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

    public void write(final Packer pk, final RexProMessageMeta v, final boolean required) throws IOException {
        RexProMessageMeta meta = v;
        if (meta == null) {
            meta = new RexProMessageMeta();
        }
        pk.writeMapBegin(meta.size());
        for (Map.Entry pair : meta.entrySet()) {
            pk.write(pair.getKey());
            pk.write(pair.getValue());
        }
        pk.writeMapEnd();
    }
View Full Code Here

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

        RexProMessageMeta meta;
        if (to != null) {
            meta = to;
            meta.clear();
        } else {
            meta = new RexProMessageMeta();
        }

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

        return meta;
    }
View Full Code Here

TOP

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

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.