package com.jscape.util.cli.ext;

import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

import static com.jscape.util.Parameters.assertNotNull;

/**
 * @author Alex Usun
 */
public class Arguments
        implements Iterable<Argument> {

    private final List<Argument> arguments;

    public Arguments(List<Argument> arguments) {
        assertNotNull(arguments);
        this.arguments = arguments;
    }

    public Arguments(Argument... arguments) {
        this(Arrays.asList(arguments));
    }

    @Override
    public Iterator<Argument> iterator() {
        return this.arguments.iterator();
    }

    @Override
    public String toString() {
        return "Arguments {"
               + "arguments=" + this.arguments
               + '}';
    }
}
