Class JsObjIO

  • All Implemented Interfaces:
    Function<JsPath,​JsFuture<JsObj>>, JsIO<JsObj>, Program<JsObj>

    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 Detail

      • JsObjIO

        public JsObjIO()
    • 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 key
        io1 - the mapping associated to the first key
        key2 - the second key
        io2 - the mapping associated to the second key
        key3 - the third key
        io3 - the mapping associated to the third key
        key4 - the forth key
        io4 - the mapping associated to the forth key
        key5 - the fifth key
        io5 - the mapping associated to the fifth key
        key6 - the sixth key
        io6 - the mapping associated to the sixth key
        key7 - the seventh key
        io7 - the mapping associated to the seventh key
        key8 - the eight key
        io8 - the mapping associated to the eight key
        key9 - the ninth key
        io9 - the mapping associated to the ninth key
        key10 - the tenth key
        io10 - the mapping associated to the tenth key
        key11 - the eleventh key
        io11 - the mapping associated to the eleventh key
        key12 - the twelfth key
        io12 - the mapping associated to the twelfth key
        key13 - the thirteenth key
        io13 - the mapping associated to the thirteenth key
        key14 - the fourteenth key
        io14 - the mapping associated to the fourteenth key
        key15 - the fifteenth key
        io15 - the mapping associated to the fifteenth key
        key16 - the sixteenth key
        io16 - 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 key
        io1 - the mapping associated to the first key
        key2 - the second key
        io2 - the mapping associated to the second key
        key3 - the third key
        io3 - the mapping associated to the third key
        key4 - the forth key
        io4 - the mapping associated to the forth key
        key5 - the fifth key
        io5 - the mapping associated to the fifth key
        key6 - the sixth key
        io6 - the mapping associated to the sixth key
        key7 - the seventh key
        io7 - the mapping associated to the seventh key
        key8 - the eight key
        io8 - the mapping associated to the eight key
        key9 - the ninth key
        io9 - the mapping associated to the ninth key
        key10 - the tenth key
        io10 - the mapping associated to the tenth key
        key11 - the eleventh key
        io11 - the mapping associated to the eleventh key
        key12 - the twelfth key
        io12 - the mapping associated to the twelfth key
        key13 - the thirteenth key
        io13 - the mapping associated to the thirteenth key
        key14 - the fourteenth key
        io14 - the mapping associated to the fourteenth key
        key15 - the fifteenth key
        io15 - 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 key
        io1 - the mapping associated to the first key
        key2 - the second key
        io2 - the mapping associated to the second key
        key3 - the third key
        io3 - the mapping associated to the third key
        key4 - the forth key
        io4 - the mapping associated to the forth key
        key5 - the fifth key
        io5 - the mapping associated to the fifth key
        key6 - the sixth key
        io6 - the mapping associated to the sixth key
        key7 - the seventh key
        io7 - the mapping associated to the seventh key
        key8 - the eight key
        io8 - the mapping associated to the eight key
        key9 - the ninth key
        io9 - the mapping associated to the ninth key
        key10 - the tenth key
        io10 - the mapping associated to the tenth key
        key11 - the eleventh key
        io11 - the mapping associated to the eleventh key
        key12 - the twelfth key
        io12 - the mapping associated to the twelfth key
        key13 - the thirteenth key
        io13 - the mapping associated to the thirteenth key
        key14 - the fourteenth key
        io14 - 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 key
        io1 - the mapping associated to the first key
        key2 - the second key
        io2 - the mapping associated to the second key
        key3 - the third key
        io3 - the mapping associated to the third key
        key4 - the forth key
        io4 - the mapping associated to the forth key
        key5 - the fifth key
        io5 - the mapping associated to the fifth key
        key6 - the sixth key
        io6 - the mapping associated to the sixth key
        key7 - the seventh key
        io7 - the mapping associated to the seventh key
        key8 - the eight key
        io8 - the mapping associated to the eight key
        key9 - the ninth key
        io9 - the mapping associated to the ninth key
        key10 - the tenth key
        io10 - the mapping associated to the tenth key
        key11 - the eleventh key
        io11 - the mapping associated to the eleventh key
        key12 - the twelfth key
        io12 - the mapping associated to the twelfth key
        key13 - the thirteenth key
        io13 - 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 key
        io1 - the mapping associated to the first key
        key2 - the second key
        io2 - the mapping associated to the second key
        key3 - the third key
        io3 - the mapping associated to the third key
        key4 - the forth key
        io4 - the mapping associated to the forth key
        key5 - the fifth key
        io5 - the mapping associated to the fifth key
        key6 - the sixth key
        io6 - the mapping associated to the sixth key
        key7 - the seventh key
        io7 - the mapping associated to the seventh key
        key8 - the eight key
        io8 - the mapping associated to the eight key
        key9 - the ninth key
        io9 - the mapping associated to the ninth key
        key10 - the tenth key
        io10 - the mapping associated to the tenth key
        key11 - the eleventh key
        io11 - the mapping associated to the eleventh key
        key12 - the twelfth key
        io12 - 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 key
        io1 - the mapping associated to the first key
        key2 - the second key
        io2 - the mapping associated to the second key
        key3 - the third key
        io3 - the mapping associated to the third key
        key4 - the forth key
        io4 - the mapping associated to the forth key
        key5 - the fifth key
        io5 - the mapping associated to the fifth key
        key6 - the sixth key
        io6 - the mapping associated to the sixth key
        key7 - the seventh key
        io7 - the mapping associated to the seventh key
        key8 - the eight key
        io8 - the mapping associated to the eight key
        key9 - the ninth key
        io9 - the mapping associated to the ninth key
        key10 - the tenth key
        io10 - the mapping associated to the tenth key
        key11 - the eleventh key
        io11 - 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 key
        io1 - the mapping associated to the first key
        key2 - the second key
        io2 - the mapping associated to the second key
        key3 - the third key
        io3 - the mapping associated to the third key
        key4 - the forth key
        io4 - the mapping associated to the forth key
        key5 - the fifth key
        io5 - the mapping associated to the fifth key
        key6 - the sixth key
        io6 - the mapping associated to the sixth key
        key7 - the seventh key
        io7 - the mapping associated to the seventh key
        key8 - the eight key
        io8 - the mapping associated to the eight key
        key9 - the ninth key
        io9 - the mapping associated to the ninth key
        key10 - the tenth key
        io10 - 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 key
        io1 - the mapping associated to the first key
        key2 - the second key
        io2 - the mapping associated to the second key
        key3 - the third key
        io3 - the mapping associated to the third key
        key4 - the forth key
        io4 - the mapping associated to the forth key
        key5 - the fifth key
        io5 - the mapping associated to the fifth key
        key6 - the sixth key
        io6 - the mapping associated to the sixth key
        key7 - the seventh key
        io7 - the mapping associated to the seventh key
        key8 - the eight key
        io8 - the mapping associated to the eight key
        key9 - the ninth key
        io9 - 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 key
        io1 - the mapping associated to the first key
        key2 - the second key
        io2 - the mapping associated to the second key
        key3 - the third key
        io3 - the mapping associated to the third key
        key4 - the forth key
        io4 - the mapping associated to the forth key
        key5 - the fifth key
        io5 - the mapping associated to the fifth key
        key6 - the sixth key
        io6 - the mapping associated to the sixth key
        key7 - the seventh key
        io7 - the mapping associated to the seventh key
        key8 - the eight key
        io8 - 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 key
        io1 - the mapping associated to the first key
        key2 - the second key
        io2 - the mapping associated to the second key
        key3 - the third key
        io3 - the mapping associated to the third key
        key4 - the forth key
        io4 - the mapping associated to the forth key
        key5 - the fifth key
        io5 - the mapping associated to the fifth key
        key6 - the sixth key
        io6 - the mapping associated to the sixth key
        key7 - the seventh key
        io7 - 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 key
        io1 - the mapping associated to the first key
        key2 - the second key
        io2 - the mapping associated to the second key
        key3 - the third key
        io3 - the mapping associated to the third key
        key4 - the forth key
        io4 - the mapping associated to the forth key
        key5 - the fifth key
        io5 - the mapping associated to the fifth key
        key6 - the sixth key
        io6 - 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 key
        io1 - the mapping associated to the first key
        key2 - the second key
        io2 - the mapping associated to the second key
        key3 - the third key
        io3 - the mapping associated to the third key
        key4 - the forth key
        io4 - the mapping associated to the forth key
        key5 - the fifth key
        io5 - 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 key
        io1 - the mapping associated to the first key
        key2 - the second key
        io2 - the mapping associated to the second key
        key3 - the third key
        io3 - the mapping associated to the third key
        key4 - the forth key
        io4 - 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 key
        io1 - the mapping associated to the first key
        key2 - the second key
        io2 - the mapping associated to the second key
        key3 - the third key
        io3 - 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 key
        io1 - the mapping associated to the first key
        key2 - the second key
        io2 - 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 key
        io - the mapping associated to the key
        Returns:
        a JsObjIO
      • promptMessage

        public Consumer<JsPath> promptMessage()
        Specified by:
        promptMessage in interface JsIO<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