com.g2forge.alexandria.wizard.CommandLineStringInput Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ax-wizard Show documentation
Show all versions of ax-wizard Show documentation
Library for building command line and GUI wizards.
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