package org.implab.gradle.common.exec.model;

import java.util.List;
import java.util.stream.Stream;

import org.eclipse.jdt.annotation.NonNullByDefault;

@NonNullByDefault
public interface CommandSpec {

    String executable();

    List<String> arguments();

    default List<String> commandLine() {
        return Stream.concat(Stream.of(executable()), arguments().stream()).toList();
    }

    public static CommandBuilder builder() {
        return new CommandSpecRecord.Builder();
    }

}
