All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.aliyun.openservices.shade.com.alibaba.fastjson.serializer.GuavaCodec Maven / Gradle / Ivy

There is a newer version: 1.9.3.Final
Show newest version
package com.aliyun.openservices.shade.com.aliyun.openservices.shade.com.alibaba.fastjson.serializer;

import com.aliyun.openservices.shade.com.aliyun.openservices.shade.com.google.common.collect.Multimap;

import java.io.IOException;
import java.lang.reflect.Type;
import java.util.Collection;
import java.util.Map;

/**
 * Created by wenshao on 15/01/2017.
 */
public class GuavaCodec implements ObjectSerializer {
    public static GuavaCodec instance = new GuavaCodec();

    public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType, int features) throws IOException {
        SerializeWriter out = serializer.out;
        if (object instanceof Multimap) {
            Multimap multimap = (Multimap) object;
            serializer.write(multimap.asMap());
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy