public class UserInput extends Object
Constructor and Description |
---|
UserInput(PrintStream output,
BufferedReader inputReader) |
Modifier and Type | Method and Description |
---|---|
String |
ask(String question) |
boolean |
confirm(String question) |
static Integer |
parseOne(String input) |
static com.google.common.collect.ImmutableSet<Integer> |
parseRange(String input) |
<T> Optional<T> |
selectOne(String prompt,
List<T> entries,
java.util.function.Function<T,String> entryFormatter) |
<T> com.google.common.collect.ImmutableSet<T> |
selectRange(String prompt,
List<T> entries,
java.util.function.Function<T,String> entryFormatter) |
public UserInput(PrintStream output, BufferedReader inputReader)
public String ask(String question) throws IOException
IOException
public boolean confirm(String question) throws IOException
IOException
public <T> Optional<T> selectOne(String prompt, List<T> entries, java.util.function.Function<T,String> entryFormatter) throws IOException
IOException
public <T> com.google.common.collect.ImmutableSet<T> selectRange(String prompt, List<T> entries, java.util.function.Function<T,String> entryFormatter) throws IOException
IOException