com.github.houbb.csv.support.context.DefaultReadContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of csv Show documentation
Show all versions of csv Show documentation
The csv read/write tool based on java annotation.
package com.github.houbb.csv.support.context;
import com.github.houbb.csv.api.IReadContext;
import com.github.houbb.heaven.support.sort.ISort;
/**
* 默认读取上下文
* @author binbin.hou
* @since 0.0.1
* @param 泛型
*/
public class DefaultReadContext implements IReadContext {
private String charset;
private ISort sort;
private String path;
private Class readClass;
private int startIndex;
private int endIndex;
public DefaultReadContext newInstance() {
return new DefaultReadContext();
}
@Override
public String charset() {
return charset;
}
public DefaultReadContext charset(String charset) {
this.charset = charset;
return this;
}
@Override
public ISort sort() {
return sort;
}
public DefaultReadContext sort(ISort sort) {
this.sort = sort;
return this;
}
@Override
public String path() {
return path;
}
public DefaultReadContext path(String path) {
this.path = path;
return this;
}
@Override
public Class readClass() {
return readClass;
}
public DefaultReadContext readClass(Class readClass) {
this.readClass = readClass;
return this;
}
@Override
public int startIndex() {
return startIndex;
}
public DefaultReadContext startIndex(int startIndex) {
this.startIndex = startIndex;
return this;
}
@Override
public int endIndex() {
return endIndex;
}
public DefaultReadContext endIndex(int endIndex) {
this.endIndex = endIndex;
return this;
}
}