public final class InputChoice
extends java.lang.Object
| Constructor and Description |
|---|
InputChoice(PluginIO pluginIO) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
inputFromList(java.util.List<T> choices,
java.util.function.Function<T,java.lang.String> show)
User must choose an input from the list
|
<T> T |
inputFromList(java.util.List<T> choices,
java.util.function.Function<T,java.lang.String> show,
java.util.Comparator<T> orderBy)
User must choose an input from the list
|
java.lang.String |
inputFromStringList(java.util.List<java.lang.String> choices,
boolean sorted)
User must choose an input from the list
|
int |
inputInt(int inclusiveMin)
Read a non negative number, inferior to max
|
int |
inputInt(int inclusiveMin,
int exclusiveMax)
Read a non negative number, inferior to max
|
java.lang.String |
inputString(LambdaExceptionUtil.ConsumerWithExceptions<java.lang.String,java.lang.IllegalArgumentException> validator) |
java.lang.String |
inputStringWithDefault(java.lang.String defaultValue,
LambdaExceptionUtil.ConsumerWithExceptions<java.lang.String,java.lang.IllegalArgumentException> validator) |
public InputChoice(PluginIO pluginIO)
public int inputInt(int inclusiveMin)
inclusiveMin - inclusive minimum value of user entrypublic int inputInt(int inclusiveMin,
int exclusiveMax)
inclusiveMin - inclusive minimum value of user entryexclusiveMax - exclusive maximum value of user entrypublic java.lang.String inputString(LambdaExceptionUtil.ConsumerWithExceptions<java.lang.String,java.lang.IllegalArgumentException> validator)
public java.lang.String inputStringWithDefault(java.lang.String defaultValue,
LambdaExceptionUtil.ConsumerWithExceptions<java.lang.String,java.lang.IllegalArgumentException> validator)
public <T> T inputFromList(java.util.List<T> choices,
java.util.function.Function<T,java.lang.String> show)
throws UserQuitException
choices - possible results, must not be emptyshow - used to display a choiceUserQuitException - if the user chooses to cancel the operationpublic <T> T inputFromList(java.util.List<T> choices,
java.util.function.Function<T,java.lang.String> show,
java.util.Comparator<T> orderBy)
throws UserQuitException
choices - possible results, must not be emptyshow - used to display a choiceorderBy - a comparator used for sorting the list of choicesUserQuitException - if the user chooses to cancel the operationpublic java.lang.String inputFromStringList(java.util.List<java.lang.String> choices,
boolean sorted)
throws UserQuitException
choices - possible results, must not be emptysorted - whether or not the list should be sortedUserQuitException - if the user chooses to cancel the operation