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

com.javaoffers.brief.modelhelper.convert.String2JsonColumnConvert Maven / Gradle / Ivy

There is a newer version: 3.6.8
Show newest version
package com.javaoffers.brief.modelhelper.convert;

import com.google.gson.Gson;
import com.javaoffers.brief.modelhelper.anno.derive.JsonColumn;
import com.javaoffers.brief.modelhelper.core.ConvertRegisterSelectorDelegate;
import com.javaoffers.brief.modelhelper.utils.GsonUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;

import java.util.Date;

public class String2JsonColumnConvert extends AbstractConver {
    @Override
    public JsonColumn convert(String json) {
        if(StringUtils.isBlank(json)){
            return null;
        }
        Class desClass = ConvertRegisterSelectorDelegate.processingConvertClass.get();
        return GsonUtils.gson.fromJson(json, desClass);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy