package com.ruoyi.system.mapper.typehandler;

import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * 2024/4/22
 */
public class StringSplitListTypeHandler extends AbstractSplitListTypeHandler<String> {
    /**
     * 转换为列表
     *
     * @param data
     * @param delimiter
     */
    @Override
    public List<String> parseToList(String data, String delimiter) {
        if (StringUtils.isBlank(data)) {
            return new ArrayList<>();
        }
        String[] split = data.split(delimiter);
        return Arrays.asList(split);
    }
}
