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

com.clickzetta.client.MultiStreamBuilder Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
package com.clickzetta.client;

import com.clickzetta.platform.client.api.Options;
import com.clickzetta.platform.client.api.multi.MultiTablesOptions;

import java.io.IOException;

public class MultiStreamBuilder {
    private ClickZettaClient client;
    private Options options = Options.DEFAULT;
    private MultiTablesOptions multiTablesOptions;

    MultiStreamBuilder(ClickZettaClient client) {
        this.client = client;
    }

    public MultiStreamBuilder options(Options options) {
        this.options = options;
        return this;
    }

    public MultiStreamBuilder multiTablesOptions(MultiTablesOptions multiTablesOptions) {
        this.multiTablesOptions = multiTablesOptions;
        return this;
    }

    private void validate() {
        if (client == null) {
            throw new IllegalArgumentException("client is null");
        }
        if (options == null) {
            throw new IllegalArgumentException("options is null");
        }
        if (multiTablesOptions == null) {
            throw new IllegalArgumentException("multiTablesOptions is null");
        }
    }

    public MultiStream build() throws IOException {
        validate();
        return new MultiStream(client, options, multiTablesOptions);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy