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

com.smartbear.readyapi.client.teststeps.datasource.FileDataSourceBuilder Maven / Gradle / Ivy

Go to download

Java client library for creating and executing test recipes against Ready!API TestServer

The newest version!
package com.smartbear.readyapi.client.teststeps.datasource;

import com.smartbear.readyapi.client.model.DataSource;
import com.smartbear.readyapi.client.model.FileDataSource;

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

public class FileDataSourceBuilder implements DataSourceBuilder {
    private FileDataSource fileDataSource = new FileDataSource();
    private List properties = new ArrayList<>();

    public FileDataSourceBuilder addProperty(String propertyName) {
        properties.add(propertyName);
        return this;
    }

    public FileDataSourceBuilder withFilePath(String filePath) {
        fileDataSource.setFile(filePath);
        return this;
    }

    public FileDataSourceBuilder withCharSet(String charSet) {
        fileDataSource.setCharset(charSet);
        return this;
    }

    public FileDataSourceBuilder withSeparator(String separator) {
        fileDataSource.setSeparator(separator);
        return this;
    }

    public FileDataSourceBuilder trim() {
        fileDataSource.setTrim(true);
        return this;
    }

    public FileDataSourceBuilder quotedValues() {
        fileDataSource.setQuotedValues(true);
        return this;
    }

    @Override
    public DataSource build() {
        DataSource dataSource = new DataSource();
        dataSource.setProperties(properties);
        dataSource.setFile(fileDataSource);
        return dataSource;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy