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

com.g2forge.alexandria.wizard.CommandLineStringInput Maven / Gradle / Ivy

The newest version!
package com.g2forge.alexandria.wizard;

import java.io.InputStream;
import java.io.PrintStream;

import com.g2forge.alexandria.command.invocation.CommandInvocation;

import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;

@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@Getter
public class CommandLineStringInput extends AInput {
	protected final CommandInvocation invocation;

	protected final int index;

	@Override
	public String get() {
		if (isEmpty()) { throw new InputUnspecifiedException("There were too few command line arguments!"); }
		return getInvocation().getArguments().get(getIndex());
	}

	@Override
	public boolean isEmpty() {
		return getInvocation().getArguments().size() <= getIndex();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy