All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.houbb.csv.support.context.DefaultWriteContext Maven / Gradle / Ivy

There is a newer version: 0.2.0
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy