Package jsonvalues.console
Interface Program<O extends Json<?>>
-
- Type Parameters:
O
- the type of the Json, either an object or an array
- All Known Implementing Classes:
JsArrayConsole
,JsObjConsole
public interface Program<O extends Json<?>>
Represents a side effect that interact with the user through the standard console to compose a Json
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description O
exec()
Execute the programdefault O
exec(String promptMessage, Function<O,String> resultFn)
Execute the program, printing out a message before and after executing.
-
-
-
Method Detail
-
exec
default O exec(String promptMessage, Function<O,String> resultFn) throws ExecutionException, InterruptedException
Execute the program, printing out a message before and after executing.- Parameters:
promptMessage
- the message printed out before the executionresultFn
- function that takes the result as a parameter and return the messages printed out after the execution- Returns:
- a Json
- Throws:
ExecutionException
- if this future completed exceptionallyInterruptedException
- if the current thread was interrupted
-
exec
O exec() throws ExecutionException, InterruptedException
Execute the program- Returns:
- a Json
- Throws:
ExecutionException
- if this future completed exceptionallyInterruptedException
- if the current thread was interrupted
-
-