Argument.java

package net.morimekta.terminal.args;

import net.morimekta.terminal.args.impl.ArgumentImpl;

import java.util.function.Consumer;
import java.util.function.Predicate;
import java.util.regex.Pattern;

public interface Argument extends Arg {
    static Builder argument(
            String name,
            String usage,
            Consumer<String> setter) {
        return ArgumentImpl.argument(name, usage, setter);
    }

    interface Builder extends Arg.Builder<Argument> {
        Builder defaultValue(Object value);

        Builder when(Predicate<String> predicate);

        Builder when(Pattern pattern);

        Builder whenNot(Pattern pattern);

        Builder repeated();

        Builder required();

        Builder hidden();
    }
}