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

dev.mccue.tools.jresolve.JResolve Maven / Gradle / Ivy

package dev.mccue.tools.jresolve;

import dev.mccue.tools.AbstractToolRunner;
import dev.mccue.tools.ExitStatusException;
import dev.mccue.tools.Tool;

import java.util.function.Consumer;
import java.util.spi.ToolProvider;

public final class JResolve extends AbstractToolRunner {

    private JResolve(Tool tool, JResolveArguments arguments) {
        super(tool, arguments);
    }

    private JResolve() {
        super(
                Tool.ofToolProvider(ToolProvider.findFirst("jresolve").orElseThrow()),
                new JResolveArguments()
        );
    }

    public static JResolve runner() {
        return new JResolve();
    }

    public static JResolve runner(Tool tool) {
        return new JResolve(tool, new JResolveArguments());
    }

    public static JResolve runner(Tool tool, JResolveArguments arguments) {
        return new JResolve(tool, arguments);
    }

    public static JResolve runner(JResolveArguments arguments) {
        return new JResolve(
                Tool.ofToolProvider(ToolProvider.findFirst("jresolve").orElseThrow()),
                arguments
        );
    }

    public static JResolve runner(Consumer consumer) {
        var jpackage = runner();
        consumer.accept(jpackage.arguments);
        return jpackage;
    }

    public static JResolve runner(Tool tool, Consumer consumer) {
        var jpackage = runner(tool);
        consumer.accept(jpackage.arguments);
        return jpackage;
    }

    public static void run(Tool tool, JResolveArguments arguments) throws ExitStatusException {
        new JResolve(tool, arguments).run();
    }

    public static void run(JResolveArguments arguments) throws ExitStatusException {
        runner(arguments).run();
    }

    public static void run(Tool tool, Consumer consumer) throws ExitStatusException {
        runner(tool, consumer).run();
    }

    public static void run(Consumer consumer) throws ExitStatusException {
        runner(consumer).run();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy