com.github.houbb.csv.support.context.DefaultWriteContext 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.IWriteContext;
import com.github.houbb.heaven.support.sort.ISort;
import java.util.List;
/**
* 默认写入上下文
* @author binbin.hou
* @since 0.0.1
* @param 泛型
*/
public class DefaultWriteContext implements IWriteContext {
private boolean writeBom;
private boolean writeHead;
private String charset;
private ISort sort;
private String path;
private List list;
/**
* 是否启动转换
* @since 0.0.6
*/
private boolean escape;
@Override
public boolean writeBom() {
return writeBom;
}
public DefaultWriteContext writeBom(boolean writeBom) {
this.writeBom = writeBom;
return this;
}
@Override
public boolean writeHead() {
return writeHead;
}
public DefaultWriteContext writeHead(boolean writeHead) {
this.writeHead = writeHead;
return this;
}
@Override
public String charset() {
return charset;
}
public DefaultWriteContext charset(String charset) {
this.charset = charset;
return this;
}
@Override
public ISort sort() {
return sort;
}
public DefaultWriteContext sort(ISort sort) {
this.sort = sort;
return this;
}
@Override
public String path() {
return path;
}
public DefaultWriteContext path(String path) {
this.path = path;
return this;
}
@Override
public List list() {
return list;
}
public DefaultWriteContext list(List list) {
this.list = list;
return this;
}
@Override
public boolean escape() {
return escape;
}
public DefaultWriteContext escape(boolean escape) {
this.escape = escape;
return this;
}
}