Package jsonvalues.console
Class JsObjIO
- java.lang.Object
-
- jsonvalues.console.JsObjIO
-
public class JsObjIO extends Object implements JsIO<JsObj>, Program<JsObj>
represents a supplier of a completable future than composes a json object from the user inputs in the standard console. It has the same recursive structure as a json object. Each key of the object has a supplier of a completable future associated that, when executed, prints out its path in the standard console and waits for the user to type in a value and press Enter. When the user fills out all the values, all the futures are completed and a json object is composed.
-
-
Constructor Summary
Constructors Constructor Description JsObjIO()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description JsFuture<JsObj>
apply(JsPath path)
JsObj
exec()
Execute the programstatic JsObjIO
of(String key, JsIO<?> io)
static factory method to create a JsObjIO of one mappingstatic JsObjIO
of(String ke1, JsIO<?> io1, String key2, JsIO<?> io2)
static factory method to create a JsObjIO of two mappingsstatic JsObjIO
of(String key1, JsIO<?> io1, String key2, JsIO<?> io2, String key3, JsIO<?> io3)
static factory method to create a JsObjIO of three mappingsstatic JsObjIO
of(String key1, JsIO<?> io1, String key2, JsIO<?> io2, String key3, JsIO<?> io3, String key4, JsIO<?> io4)
static factory method to create a JsObjIO of four mappingsstatic JsObjIO
of(String key1, JsIO<?> io1, String key2, JsIO<?> io2, String key3, JsIO<?> io3, String key4, JsIO<?> io4, String key5, JsIO<?> io5)
static factory method to create a JsObjIO of five mappingsstatic JsObjIO
of(String key1, JsIO<?> io1, String key2, JsIO<?> io2, String key3, JsIO<?> io3, String key4, JsIO<?> io4, String key5, JsIO<?> io5, String key6, JsIO<?> io6)
static factory method to create a JsObjIO of six mappingsstatic JsObjIO
of(String key1, JsIO<?> io1, String key2, JsIO<?> io2, String key3, JsIO<?> io3, String key4, JsIO<?> io4, String key5, JsIO<?> io5, String key6, JsIO<?> io6, String key7, JsIO<?> io7)
static factory method to create a JsObjIO of seven mappingsstatic JsObjIO
of(String key1, JsIO<?> io1, String key2, JsIO<?> io2, String key3, JsIO<?> io3, String key4, JsIO<?> io4, String key5, JsIO<?> io5, String key6, JsIO<?> io6, String key7, JsIO<?> io7, String key8, JsIO<?> io8)
static factory method to create a JsObjIO of eight mappingsstatic JsObjIO
of(String key1, JsIO<?> io1, String key2, JsIO<?> io2, String key3, JsIO<?> io3, String key4, JsIO<?> io4, String key5, JsIO<?> io5, String key6, JsIO<?> io6, String key7, JsIO<?> io7, String key8, JsIO<?> io8, String key9, JsIO<?> io9)
static factory method to create a JsObjIO of nine mappingsstatic JsObjIO
of(String key1, JsIO<?> io1, String key2, JsIO<?> io2, String key3, JsIO<?> io3, String key4, JsIO<?> io4, String key5, JsIO<?> io5, String key6, JsIO<?> io6, String key7, JsIO<?> io7, String key8, JsIO<?> io8, String key9, JsIO<?> io9, String key10, JsIO<?> io10)
static factory method to create a JsObjIO of ten mappingsstatic JsObjIO
of(String key1, JsIO<?> io1, String key2, JsIO<?> io2, String key3, JsIO<?> io3, String key4, JsIO<?> io4, String key5, JsIO<?> io5, String key6, JsIO<?> io6, String key7, JsIO<?> io7, String key8, JsIO<?> io8, String key9, JsIO<?> io9, String key10, JsIO<?> io10, String key11, JsIO<?> io11)
static factory method to create a JsObjIO of eleven mappingsstatic JsObjIO
of(String key1, JsIO<?> io1, String key2, JsIO<?> io2, String key3, JsIO<?> io3, String key4, JsIO<?> io4, String key5, JsIO<?> io5, String key6, JsIO<?> io6, String key7, JsIO<?> io7, String key8, JsIO<?> io8, String key9, JsIO<?> io9, String key10, JsIO<?> io10, String key11, JsIO<?> io11, String key12, JsIO<?> io12)
static factory method to create a JsObjIO of twelve mappingsstatic JsObjIO
of(String key1, JsIO<?> io1, String key2, JsIO<?> io2, String key3, JsIO<?> io3, String key4, JsIO<?> io4, String key5, JsIO<?> io5, String key6, JsIO<?> io6, String key7, JsIO<?> io7, String key8, JsIO<?> io8, String key9, JsIO<?> io9, String key10, JsIO<?> io10, String key11, JsIO<?> io11, String key12, JsIO<?> io12, String key13, JsIO<?> io13)
static factory method to create a JsObjIO of thirteen mappingsstatic JsObjIO
of(String key1, JsIO<?> io1, String key2, JsIO<?> io2, String key3, JsIO<?> io3, String key4, JsIO<?> io4, String key5, JsIO<?> io5, String key6, JsIO<?> io6, String key7, JsIO<?> io7, String key8, JsIO<?> io8, String key9, JsIO<?> io9, String key10, JsIO<?> io10, String key11, JsIO<?> io11, String key12, JsIO<?> io12, String key13, JsIO<?> io13, String key14, JsIO<?> io14)
static factory method to create a JsObjIO of fourteen mappingsstatic JsObjIO
of(String key1, JsIO<?> io1, String key2, JsIO<?> io2, String key3, JsIO<?> io3, String key4, JsIO<?> io4, String key5, JsIO<?> io5, String key6, JsIO<?> io6, String key7, JsIO<?> io7, String key8, JsIO<?> io8, String key9, JsIO<?> io9, String key10, JsIO<?> io10, String key11, JsIO<?> io11, String key12, JsIO<?> io12, String key13, JsIO<?> io13, String key14, JsIO<?> io14, String key15, JsIO<?> io15)
static factory method to create a JsObjIO of fifteen mappingsstatic JsObjIO
of(String key1, JsIO<?> io1, String key2, JsIO<?> io2, String key3, JsIO<?> io3, String key4, JsIO<?> io4, String key5, JsIO<?> io5, String key6, JsIO<?> io6, String key7, JsIO<?> io7, String key8, JsIO<?> io8, String key9, JsIO<?> io9, String key10, JsIO<?> io10, String key11, JsIO<?> io11, String key12, JsIO<?> io12, String key13, JsIO<?> io13, String key14, JsIO<?> io14, String key15, JsIO<?> io15, String key16, JsIO<?> io16)
static factory method to create a JsObjIO of sixteen mappingsConsumer<JsPath>
promptMessage()
-
-
-
Method Detail
-
of
public static JsObjIO of(String key1, JsIO<?> io1, String key2, JsIO<?> io2, String key3, JsIO<?> io3, String key4, JsIO<?> io4, String key5, JsIO<?> io5, String key6, JsIO<?> io6, String key7, JsIO<?> io7, String key8, JsIO<?> io8, String key9, JsIO<?> io9, String key10, JsIO<?> io10, String key11, JsIO<?> io11, String key12, JsIO<?> io12, String key13, JsIO<?> io13, String key14, JsIO<?> io14, String key15, JsIO<?> io15, String key16, JsIO<?> io16)
static factory method to create a JsObjIO of sixteen mappings- Parameters:
key1
- the first keyio1
- the mapping associated to the first keykey2
- the second keyio2
- the mapping associated to the second keykey3
- the third keyio3
- the mapping associated to the third keykey4
- the forth keyio4
- the mapping associated to the forth keykey5
- the fifth keyio5
- the mapping associated to the fifth keykey6
- the sixth keyio6
- the mapping associated to the sixth keykey7
- the seventh keyio7
- the mapping associated to the seventh keykey8
- the eight keyio8
- the mapping associated to the eight keykey9
- the ninth keyio9
- the mapping associated to the ninth keykey10
- the tenth keyio10
- the mapping associated to the tenth keykey11
- the eleventh keyio11
- the mapping associated to the eleventh keykey12
- the twelfth keyio12
- the mapping associated to the twelfth keykey13
- the thirteenth keyio13
- the mapping associated to the thirteenth keykey14
- the fourteenth keyio14
- the mapping associated to the fourteenth keykey15
- the fifteenth keyio15
- the mapping associated to the fifteenth keykey16
- the sixteenth keyio16
- the mapping associated to the sixteenth key- Returns:
- a JsObjIO
-
of
public static JsObjIO of(String key1, JsIO<?> io1, String key2, JsIO<?> io2, String key3, JsIO<?> io3, String key4, JsIO<?> io4, String key5, JsIO<?> io5, String key6, JsIO<?> io6, String key7, JsIO<?> io7, String key8, JsIO<?> io8, String key9, JsIO<?> io9, String key10, JsIO<?> io10, String key11, JsIO<?> io11, String key12, JsIO<?> io12, String key13, JsIO<?> io13, String key14, JsIO<?> io14, String key15, JsIO<?> io15)
static factory method to create a JsObjIO of fifteen mappings- Parameters:
key1
- the first keyio1
- the mapping associated to the first keykey2
- the second keyio2
- the mapping associated to the second keykey3
- the third keyio3
- the mapping associated to the third keykey4
- the forth keyio4
- the mapping associated to the forth keykey5
- the fifth keyio5
- the mapping associated to the fifth keykey6
- the sixth keyio6
- the mapping associated to the sixth keykey7
- the seventh keyio7
- the mapping associated to the seventh keykey8
- the eight keyio8
- the mapping associated to the eight keykey9
- the ninth keyio9
- the mapping associated to the ninth keykey10
- the tenth keyio10
- the mapping associated to the tenth keykey11
- the eleventh keyio11
- the mapping associated to the eleventh keykey12
- the twelfth keyio12
- the mapping associated to the twelfth keykey13
- the thirteenth keyio13
- the mapping associated to the thirteenth keykey14
- the fourteenth keyio14
- the mapping associated to the fourteenth keykey15
- the fifteenth keyio15
- the mapping associated to the fifteenth key- Returns:
- a JsObjIO
-
of
public static JsObjIO of(String key1, JsIO<?> io1, String key2, JsIO<?> io2, String key3, JsIO<?> io3, String key4, JsIO<?> io4, String key5, JsIO<?> io5, String key6, JsIO<?> io6, String key7, JsIO<?> io7, String key8, JsIO<?> io8, String key9, JsIO<?> io9, String key10, JsIO<?> io10, String key11, JsIO<?> io11, String key12, JsIO<?> io12, String key13, JsIO<?> io13, String key14, JsIO<?> io14)
static factory method to create a JsObjIO of fourteen mappings- Parameters:
key1
- the first keyio1
- the mapping associated to the first keykey2
- the second keyio2
- the mapping associated to the second keykey3
- the third keyio3
- the mapping associated to the third keykey4
- the forth keyio4
- the mapping associated to the forth keykey5
- the fifth keyio5
- the mapping associated to the fifth keykey6
- the sixth keyio6
- the mapping associated to the sixth keykey7
- the seventh keyio7
- the mapping associated to the seventh keykey8
- the eight keyio8
- the mapping associated to the eight keykey9
- the ninth keyio9
- the mapping associated to the ninth keykey10
- the tenth keyio10
- the mapping associated to the tenth keykey11
- the eleventh keyio11
- the mapping associated to the eleventh keykey12
- the twelfth keyio12
- the mapping associated to the twelfth keykey13
- the thirteenth keyio13
- the mapping associated to the thirteenth keykey14
- the fourteenth keyio14
- the mapping associated to the fourteenth key- Returns:
- a JsObjIO
-
of
public static JsObjIO of(String key1, JsIO<?> io1, String key2, JsIO<?> io2, String key3, JsIO<?> io3, String key4, JsIO<?> io4, String key5, JsIO<?> io5, String key6, JsIO<?> io6, String key7, JsIO<?> io7, String key8, JsIO<?> io8, String key9, JsIO<?> io9, String key10, JsIO<?> io10, String key11, JsIO<?> io11, String key12, JsIO<?> io12, String key13, JsIO<?> io13)
static factory method to create a JsObjIO of thirteen mappings- Parameters:
key1
- the first keyio1
- the mapping associated to the first keykey2
- the second keyio2
- the mapping associated to the second keykey3
- the third keyio3
- the mapping associated to the third keykey4
- the forth keyio4
- the mapping associated to the forth keykey5
- the fifth keyio5
- the mapping associated to the fifth keykey6
- the sixth keyio6
- the mapping associated to the sixth keykey7
- the seventh keyio7
- the mapping associated to the seventh keykey8
- the eight keyio8
- the mapping associated to the eight keykey9
- the ninth keyio9
- the mapping associated to the ninth keykey10
- the tenth keyio10
- the mapping associated to the tenth keykey11
- the eleventh keyio11
- the mapping associated to the eleventh keykey12
- the twelfth keyio12
- the mapping associated to the twelfth keykey13
- the thirteenth keyio13
- the mapping associated to the thirteenth key- Returns:
- a JsObjIO
-
of
public static JsObjIO of(String key1, JsIO<?> io1, String key2, JsIO<?> io2, String key3, JsIO<?> io3, String key4, JsIO<?> io4, String key5, JsIO<?> io5, String key6, JsIO<?> io6, String key7, JsIO<?> io7, String key8, JsIO<?> io8, String key9, JsIO<?> io9, String key10, JsIO<?> io10, String key11, JsIO<?> io11, String key12, JsIO<?> io12)
static factory method to create a JsObjIO of twelve mappings- Parameters:
key1
- the first keyio1
- the mapping associated to the first keykey2
- the second keyio2
- the mapping associated to the second keykey3
- the third keyio3
- the mapping associated to the third keykey4
- the forth keyio4
- the mapping associated to the forth keykey5
- the fifth keyio5
- the mapping associated to the fifth keykey6
- the sixth keyio6
- the mapping associated to the sixth keykey7
- the seventh keyio7
- the mapping associated to the seventh keykey8
- the eight keyio8
- the mapping associated to the eight keykey9
- the ninth keyio9
- the mapping associated to the ninth keykey10
- the tenth keyio10
- the mapping associated to the tenth keykey11
- the eleventh keyio11
- the mapping associated to the eleventh keykey12
- the twelfth keyio12
- the mapping associated to the twelfth key- Returns:
- a JsObjIO
-
of
public static JsObjIO of(String key1, JsIO<?> io1, String key2, JsIO<?> io2, String key3, JsIO<?> io3, String key4, JsIO<?> io4, String key5, JsIO<?> io5, String key6, JsIO<?> io6, String key7, JsIO<?> io7, String key8, JsIO<?> io8, String key9, JsIO<?> io9, String key10, JsIO<?> io10, String key11, JsIO<?> io11)
static factory method to create a JsObjIO of eleven mappings- Parameters:
key1
- the first keyio1
- the mapping associated to the first keykey2
- the second keyio2
- the mapping associated to the second keykey3
- the third keyio3
- the mapping associated to the third keykey4
- the forth keyio4
- the mapping associated to the forth keykey5
- the fifth keyio5
- the mapping associated to the fifth keykey6
- the sixth keyio6
- the mapping associated to the sixth keykey7
- the seventh keyio7
- the mapping associated to the seventh keykey8
- the eight keyio8
- the mapping associated to the eight keykey9
- the ninth keyio9
- the mapping associated to the ninth keykey10
- the tenth keyio10
- the mapping associated to the tenth keykey11
- the eleventh keyio11
- the mapping associated to the eleventh key- Returns:
- a JsObjIO
-
of
public static JsObjIO of(String key1, JsIO<?> io1, String key2, JsIO<?> io2, String key3, JsIO<?> io3, String key4, JsIO<?> io4, String key5, JsIO<?> io5, String key6, JsIO<?> io6, String key7, JsIO<?> io7, String key8, JsIO<?> io8, String key9, JsIO<?> io9, String key10, JsIO<?> io10)
static factory method to create a JsObjIO of ten mappings- Parameters:
key1
- the first keyio1
- the mapping associated to the first keykey2
- the second keyio2
- the mapping associated to the second keykey3
- the third keyio3
- the mapping associated to the third keykey4
- the forth keyio4
- the mapping associated to the forth keykey5
- the fifth keyio5
- the mapping associated to the fifth keykey6
- the sixth keyio6
- the mapping associated to the sixth keykey7
- the seventh keyio7
- the mapping associated to the seventh keykey8
- the eight keyio8
- the mapping associated to the eight keykey9
- the ninth keyio9
- the mapping associated to the ninth keykey10
- the tenth keyio10
- the mapping associated to the tenth key- Returns:
- a JsObjIO
-
of
public static JsObjIO of(String key1, JsIO<?> io1, String key2, JsIO<?> io2, String key3, JsIO<?> io3, String key4, JsIO<?> io4, String key5, JsIO<?> io5, String key6, JsIO<?> io6, String key7, JsIO<?> io7, String key8, JsIO<?> io8, String key9, JsIO<?> io9)
static factory method to create a JsObjIO of nine mappings- Parameters:
key1
- the first keyio1
- the mapping associated to the first keykey2
- the second keyio2
- the mapping associated to the second keykey3
- the third keyio3
- the mapping associated to the third keykey4
- the forth keyio4
- the mapping associated to the forth keykey5
- the fifth keyio5
- the mapping associated to the fifth keykey6
- the sixth keyio6
- the mapping associated to the sixth keykey7
- the seventh keyio7
- the mapping associated to the seventh keykey8
- the eight keyio8
- the mapping associated to the eight keykey9
- the ninth keyio9
- the mapping associated to the ninth key- Returns:
- a JsObjIO
-
of
public static JsObjIO of(String key1, JsIO<?> io1, String key2, JsIO<?> io2, String key3, JsIO<?> io3, String key4, JsIO<?> io4, String key5, JsIO<?> io5, String key6, JsIO<?> io6, String key7, JsIO<?> io7, String key8, JsIO<?> io8)
static factory method to create a JsObjIO of eight mappings- Parameters:
key1
- the first keyio1
- the mapping associated to the first keykey2
- the second keyio2
- the mapping associated to the second keykey3
- the third keyio3
- the mapping associated to the third keykey4
- the forth keyio4
- the mapping associated to the forth keykey5
- the fifth keyio5
- the mapping associated to the fifth keykey6
- the sixth keyio6
- the mapping associated to the sixth keykey7
- the seventh keyio7
- the mapping associated to the seventh keykey8
- the eight keyio8
- the mapping associated to the eight key- Returns:
- a JsObjIO
-
of
public static JsObjIO of(String key1, JsIO<?> io1, String key2, JsIO<?> io2, String key3, JsIO<?> io3, String key4, JsIO<?> io4, String key5, JsIO<?> io5, String key6, JsIO<?> io6, String key7, JsIO<?> io7)
static factory method to create a JsObjIO of seven mappings- Parameters:
key1
- the first keyio1
- the mapping associated to the first keykey2
- the second keyio2
- the mapping associated to the second keykey3
- the third keyio3
- the mapping associated to the third keykey4
- the forth keyio4
- the mapping associated to the forth keykey5
- the fifth keyio5
- the mapping associated to the fifth keykey6
- the sixth keyio6
- the mapping associated to the sixth keykey7
- the seventh keyio7
- the mapping associated to the seventh key- Returns:
- a JsObjIO
-
of
public static JsObjIO of(String key1, JsIO<?> io1, String key2, JsIO<?> io2, String key3, JsIO<?> io3, String key4, JsIO<?> io4, String key5, JsIO<?> io5, String key6, JsIO<?> io6)
static factory method to create a JsObjIO of six mappings- Parameters:
key1
- the first keyio1
- the mapping associated to the first keykey2
- the second keyio2
- the mapping associated to the second keykey3
- the third keyio3
- the mapping associated to the third keykey4
- the forth keyio4
- the mapping associated to the forth keykey5
- the fifth keyio5
- the mapping associated to the fifth keykey6
- the sixth keyio6
- the mapping associated to the sixth key- Returns:
- a JsObjIO
-
of
public static JsObjIO of(String key1, JsIO<?> io1, String key2, JsIO<?> io2, String key3, JsIO<?> io3, String key4, JsIO<?> io4, String key5, JsIO<?> io5)
static factory method to create a JsObjIO of five mappings- Parameters:
key1
- the first keyio1
- the mapping associated to the first keykey2
- the second keyio2
- the mapping associated to the second keykey3
- the third keyio3
- the mapping associated to the third keykey4
- the forth keyio4
- the mapping associated to the forth keykey5
- the fifth keyio5
- the mapping associated to the fifth key- Returns:
- a JsObjIO
-
of
public static JsObjIO of(String key1, JsIO<?> io1, String key2, JsIO<?> io2, String key3, JsIO<?> io3, String key4, JsIO<?> io4)
static factory method to create a JsObjIO of four mappings- Parameters:
key1
- the first keyio1
- the mapping associated to the first keykey2
- the second keyio2
- the mapping associated to the second keykey3
- the third keyio3
- the mapping associated to the third keykey4
- the forth keyio4
- the mapping associated to the forth key- Returns:
- a JsObjIO
-
of
public static JsObjIO of(String key1, JsIO<?> io1, String key2, JsIO<?> io2, String key3, JsIO<?> io3)
static factory method to create a JsObjIO of three mappings- Parameters:
key1
- the first keyio1
- the mapping associated to the first keykey2
- the second keyio2
- the mapping associated to the second keykey3
- the third keyio3
- the mapping associated to the third key- Returns:
- a JsObjIO
-
of
public static JsObjIO of(String ke1, JsIO<?> io1, String key2, JsIO<?> io2)
static factory method to create a JsObjIO of two mappings- Parameters:
ke1
- the first keyio1
- the mapping associated to the first keykey2
- the second keyio2
- the mapping associated to the second key- Returns:
- a JsObjIO
-
of
public static JsObjIO of(String key, JsIO<?> io)
static factory method to create a JsObjIO of one mapping- Parameters:
key
- the keyio
- the mapping associated to the key- Returns:
- a JsObjIO
-
exec
public JsObj exec() throws ExecutionException, InterruptedException
Description copied from interface:Program
Execute the program- Specified by:
exec
in interfaceProgram<JsObj>
- Returns:
- a Json
- Throws:
ExecutionException
- if this future completed exceptionallyInterruptedException
- if the current thread was interrupted
-
promptMessage
public Consumer<JsPath> promptMessage()
- Specified by:
promptMessage
in interfaceJsIO<JsObj>
- Returns:
- consumer that accepts a path and prints out a message indicating to the user that they must type in the value associated to that path
-
-