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 Oexec()Execute the programdefault Oexec(java.lang.String promptMessage, java.util.function.Function<O,java.lang.String> resultFn)Execute the program, printing out a message before and after executing.
-
-
-
Method Detail
-
exec
default O exec(java.lang.String promptMessage, java.util.function.Function<O,java.lang.String> resultFn) throws java.util.concurrent.ExecutionException, java.lang.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:
java.util.concurrent.ExecutionException- if this future completed exceptionallyjava.lang.InterruptedException- if the current thread was interrupted
-
exec
O exec() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Execute the program- Returns:
- a Json
- Throws:
java.util.concurrent.ExecutionException- if this future completed exceptionallyjava.lang.InterruptedException- if the current thread was interrupted
-
-