
com.qiniu.service.convert.LineToMap Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of qsuits Show documentation
Show all versions of qsuits Show documentation
qiniu-suits is a efficient tools for qiniu api implemented by java8.
package com.qiniu.service.convert;
import com.qiniu.service.line.JsonStrParser;
import com.qiniu.service.line.SplitLineParser;
import com.qiniu.service.interfaces.ILineParser;
import com.qiniu.service.interfaces.ITypeConvert;
import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;
public class LineToMap implements ITypeConvert> {
private ILineParser lineParser;
private List errorList = new ArrayList<>();
public LineToMap(String parseType, String separator, Map indexMap) throws IOException {
if ("json".equals(parseType)) {
this.lineParser = new JsonStrParser(indexMap);
} else if ("csv".equals(parseType)) {
this.lineParser = new SplitLineParser(",", indexMap);
} else if ("tab".equals(parseType)) {
this.lineParser = new SplitLineParser(separator, indexMap);
} else {
throw new IOException("please check your format for line to map.");
}
}
public List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy