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

com.harrys.hyppo.source.api.model.TaskBuilder Maven / Gradle / Ivy

There is a newer version: 0.6.4
Show newest version
package com.harrys.hyppo.source.api.model;

import com.typesafe.config.Config;
import com.typesafe.config.ConfigValueFactory;

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

/**
 * Created by jpetty on 8/27/15.
 */
public final class TaskBuilder {

    private final List tasks;

    public TaskBuilder() {
        this.tasks = new ArrayList<>();
    }

    public final TaskBuilder addTask(Config taskArguments) {
        this.tasks.add(new DataIngestionTask(null, this.tasks.size() + 1, taskArguments));
        return this;
    }

    public final TaskBuilder addTask(final Map taskArguments) {
        final Config args = ConfigValueFactory.fromMap(taskArguments).toConfig();
        return this.addTask(args);
    }

    public final List build() {
        final ArrayList output = new ArrayList(this.tasks);
        return output;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy