public interface Input<T>
Modifier and Type | Method and Description |
---|---|
java.lang.String |
describe()
A String to describe the given input.
|
void |
getNextInput(Bound<java.lang.Integer> sizeHint,
java.util.function.Consumer<java.util.List<T>> callback)
Gets the next input.
|
default void |
getNextInputUntyped(Bound<java.lang.Integer> sizeHint,
java.util.function.Consumer<java.util.List<?>> callback)
Gets the next input.
|
boolean |
hasNextInput()
Returns whether this input has a next input list.
|
void getNextInput(Bound<java.lang.Integer> sizeHint, java.util.function.Consumer<java.util.List<T>> callback)
sizeHint
- A hint for the desired size of the input. Some inputs will consider it,
others won't. Inputs are not required to consider the sizeHint.callback
- The callback to give the next input to. This allows for inputs to be non-blocking
and still get user input if needed.java.lang.IllegalStateException
- If the input has no next input.java.lang.IllegalArgumentException
- If the provided size hint is negative.default void getNextInputUntyped(Bound<java.lang.Integer> sizeHint, java.util.function.Consumer<java.util.List<?>> callback)
getNextInput(Bound, Consumer)
, however this version can
be used if the actual generic parameters are not known. The callback is still passed a list of type Listboolean hasNextInput()
java.lang.String describe()