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

io.quarkus.devtools.codestarts.CodestartProjectInputBuilder Maven / Gradle / Ivy

package io.quarkus.devtools.codestarts;

import io.quarkus.devtools.messagewriter.MessageWriter;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

public class CodestartProjectInputBuilder {
    Collection dependencies = new ArrayList<>();
    CodestartsSelection selection = new CodestartsSelection();
    Map data = new HashMap<>();
    MessageWriter messageWriter = MessageWriter.info();

    protected CodestartProjectInputBuilder() {

    }

    public CodestartProjectInputBuilder addDependencies(Collection dependencies) {
        this.dependencies.addAll(dependencies);
        return this;
    }

    public CodestartProjectInputBuilder addDependency(String dependency) {
        return this.addDependencies(Collections.singletonList(dependency));
    }

    public CodestartProjectInputBuilder addCodestarts(Collection codestarts) {
        this.selection.addNames(codestarts);
        return this;
    }

    public CodestartProjectInputBuilder addCodestart(String name) {
        this.selection.addName(name);
        return this;
    }

    public CodestartProjectInputBuilder addData(Map data) {
        this.data.putAll(data);
        return this;
    }

    public CodestartProjectInputBuilder putData(String key, Object value) {
        this.data.put(key, value);
        return this;
    }

    public CodestartProjectInputBuilder messageWriter(MessageWriter messageWriter) {
        this.messageWriter = messageWriter;
        return this;
    }

    public CodestartProjectInput build() {
        return new CodestartProjectInput(this);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy