Package io.fathom.cloud.protobuf.mapper

Examples of io.fathom.cloud.protobuf.mapper.MessageMapper


    public static void serialize(Message src, JsonWriter json) throws IOException {
        ProtobufJsonWriter writer = new ProtobufJsonWriter(json);

        Descriptor descriptor = src.getDescriptorForType();
        MessageMapper mapper = MessageMapper.getMessageMapper(descriptor);
        mapper.write(src, writer);
    }
View Full Code Here


    public void write(Object o) throws IOException {
        if (o instanceof Message) {
            Message message = (Message) o;
            Descriptor descriptor = message.getDescriptorForType();
            MessageMapper mapper = MessageMapper.getMessageMapper(descriptor);
            mapper.write(message, protobuf);
        } else if (o instanceof List) {
            protobuf.beginArray();
            for (Object i : (List) o) {
                write(i);
            }
View Full Code Here

    }

    public static void serialize(Message src, Writer out, char separator) throws IOException {
        ProtobufPropertiesWriter writer = new ProtobufPropertiesWriter(out, separator);
        Descriptor descriptor = src.getDescriptorForType();
        MessageMapper mapper = MessageMapper.getMessageMapper(descriptor);
        mapper.write(src, writer);
    }
View Full Code Here

    }

    public static void serialize(Message src, Writer out) throws IOException {
        ProtobufYamlWriter writer = new ProtobufYamlWriter(out);
        Descriptor descriptor = src.getDescriptorForType();
        MessageMapper mapper = MessageMapper.getMessageMapper(descriptor);
        mapper.write(src, writer);
    }
View Full Code Here

    public static void serialize(List<? extends Message> src, Writer out) throws IOException {
        ProtobufYamlWriter writer = new ProtobufYamlWriter(out);

        for (Message message : src) {
            Descriptor descriptor = message.getDescriptorForType();
            MessageMapper mapper = MessageMapper.getMessageMapper(descriptor);
            mapper.write(message, writer);
        }
    }
View Full Code Here

public class ProtobufJsonReader {

    public static void deserialize(Message.Builder dest, JsonReader json) throws IOException {
        Descriptor descriptor = dest.getDescriptorForType();
        MessageMapper mapper = MessageMapper.getMessageMapper(descriptor);
        mapper.read(dest, json);
    }
View Full Code Here

TOP

Related Classes of io.fathom.cloud.protobuf.mapper.MessageMapper

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.