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

dev.gradleplugins.runnerkit.providers.CommandLineArgumentsProvider Maven / Gradle / Ivy

There is a newer version: 0.0.148
Show newest version
package dev.gradleplugins.runnerkit.providers;

import lombok.val;

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

import static java.util.Collections.emptyList;
import static java.util.Collections.unmodifiableList;

public final class CommandLineArgumentsProvider extends AbstractGradleExecutionProvider> implements GradleExecutionCommandLineProvider {

    public static CommandLineArgumentsProvider empty() {
        return fixed(CommandLineArgumentsProvider.class, emptyList());
    }

    public static CommandLineArgumentsProvider of(List arguments) {
        return fixed(CommandLineArgumentsProvider.class, unmodifiableList(arguments));
    }

    public CommandLineArgumentsProvider plus(String argument) {
        val result = new ArrayList(get());
        result.add(argument);
        return fixed(CommandLineArgumentsProvider.class, unmodifiableList(result));
    }

    @Override
    public List getAsArguments() {
        return get();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy