LineConvert.java 771 Bytes
package com.lijinji.part.bean.convert;

import com.google.gson.Gson;
import com.lijinji.part.bean.LineBean;
import com.lijinji.part.bean.WorkProcessBean;

import org.greenrobot.greendao.converter.PropertyConverter;

public class LineConvert implements PropertyConverter<LineBean, String> {


    @Override
    public LineBean convertToEntityProperty(String databaseValue) {
        if (databaseValue == null) {
            return null;
        }
        LineBean lineBean = new Gson().fromJson(databaseValue, LineBean.class);
        return lineBean;
    }

    @Override
    public String convertToDatabaseValue(LineBean entityProperty) {
        if (entityProperty == null) {
            return null;
        }
        return new Gson().toJson(entityProperty);
    }
}