package cn.cslg.pas.common.utils.handler;

import cn.cslg.pas.common.utils.StringUtils;

import java.util.List;

public class PatenticsAgencyAndAgentHandler implements IProcessData {
    public PatenticsAgencyAndAgentHandler() {
    }

    @Override
    public Object processData(Object data, Object code) {
        List<String> splitStr = StringUtils.changeStringToString(data.toString().replaceAll(" ", ""), ";");
        if (code.toString().equals("1")) {
            return splitStr.get(0);
        } else if (code.toString().equals("2")) {
            splitStr.remove(0);
            return splitStr;
        }
        return null;
    }
}
