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

com.fasc.open.api.stratey.DefaultJsonStrategy Maven / Gradle / Ivy

The newest version!
package com.fasc.open.api.stratey;

import com.fasc.open.api.exception.ApiException;
import com.fasc.open.api.utils.json.JacksonUtil;

import java.lang.reflect.ParameterizedType;
import java.util.List;

/**
 * @author Fadada
 * 2021/9/8 16:32:01
 */
public class DefaultJsonStrategy implements JsonStrategy {

    @Override
    public String toJson(Object object) throws ApiException {
        return JacksonUtil.toJson(object);
    }

    @Override
    public  T toJavaBean(String json, ParameterizedType parameterizedType) throws ApiException {
        return JacksonUtil.toJavaBean(json, parameterizedType);
    }

    @Override
    public  T toJavaBean(String json, Class clzz) throws ApiException {
        return JacksonUtil.toJavaBean(json, clzz);
    }

    @Override
    public  List toList(String json, Class clzz) throws ApiException {
        return JacksonUtil.toList(json, clzz);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy