Class Viv

java.lang.Object
com.benesult.vivjson.Viv

public class Viv extends Object
API of VivJson.

The relationship of this script's value and Java's value are described as below.
Note that the following "block" is equivalent to JSON's object.


 | This script's value | Java's value                      |
 |---------------------|-----------------------------------|
 | boolean             | Boolean                           |
 | int                 | Long                              |
 | float               | Double                            |
 | string              | String                            |
 | array               | ArrayList<@Nullable Object>       |
 | block               | HashMap<String, @Nullable Object> |
 | null                | null                              |
 
"@Nullable Object" of ArrayList/HashMap is also the above right-hand sided value.
In Viv.runEx method, the argument is the above left-hand sided value, script's code, or parsed statement (Refer to parse(Object...) Viv.parse). And its returned value is the above right-hand sided value.
Then the exception is thrown if error occurs.
On the other hand, Viv.run method does not throw the exception even if error occurs. Because its returned value is a class instance that has not only the value but also error message.
To tell the truth, the returned value of Viv.runEx method is Object even if the actual value is Boolean, Long, and so on. So conversion functions are available. They can be accepted the above left-hand sided value, script's code, or parsed statement as argument. In other words, they can be used instead of Viv.runEx method.

Environment: Java 9 or later

Last modified: 2025-03-30

Author:
Fumiaki Motegi (motegi@benesult.com)
  • Constructor Details

    • Viv

      public Viv()
  • Method Details

    • run

      public static Viv.Result run(Object... parameters)
      Runs VivJson's code or deserialize JSON objects.

      For example,

      
         Viv.Result result = Viv.run("a:3,b:2,return(a+b)");
         if (result.errorMessage.isEmpty()) {
           System.out.println((Long) result.value);  // 5
         }
         else {
           System.err.println(result.errorMessage);
         }
      
         // {"a": 3, "b": [2, 1]}
         result = Viv.run("{\"a\": 3, \"b\": [2, 1]}");
         if (result.errorMessage.isEmpty()) {
           HashMap<String, @Nullable Object> map =
               (HashMap<String, @Nullable Object>) result.value;
           System.out.println(map.get("a"));  // 3
           ArrayList<@Nullable Object> list =
               (ArrayList<@Nullable Object>) map.get("b");
           System.out.println(list.get(0));  // 2
         }
         else {
           System.err.println(result.errorMessage);
         }
       

      Multiple arguments can be accepted as below.

      
         - Viv.run("{a:3,b:2}", "return(a+b)");  // 5
         - Viv.run("x=", "+", "{a:3,b:2}", "return(x.a+x.b)");  // 5
         - Viv.run("test.viv");
         - Viv.run("data.json", "calc.viv");
         - Viv.run(new Viv.Json("{a:3,b:2}"), "calc.viv");
         - ArrayList<Object> array = new ArrayList<>();
           array.add(1); array.add(2);
           HashMap<String, Object> data = new HashMap<>();
           data.put("x", array); data.put("y", true);  // {"x":[1,2],"y":true}
           Viv.run(data,"return(if(y){:=x[0]}else{:=x[1]})");  // 1
         - Config config = new Config(); config.enableStderr();
           Viv.run("x/", config);  // Error
       

      The above examples are suitable if running times is only one. Otherwise, running after parsing is suitable. Parsing is done with parse(Object...). Then the parsed statement is given as the argument of this method.

      
         Viv.Parsed parsed = Viv.parse("return(a+b)");
      
         Viv.Result result = Viv.run("{a:3,b:2}", parsed);
         System.out.println((Long) result.value);  // 5
      
         HashMap<String, Integer> variables = new HashMap<>();
         variables.put("a", 5);
         variables.put("b", 7);
         result = Viv.run(variables, parsed);
         System.out.println((Long) result.value);  // 12
      
         variables.replace("b", 10);
         result = Viv.run(variables, parsed);
         System.out.println((Long) result.value);  // 15
       
      Alternatively, makeInstance(Object...) is suitable. The example is described in the description of makeInstance(Object...).

      Note that the returned value is the following Java's Object.

      • Boolean
      • Long
      • Double
      • String
      • ArrayList<@Nullable Object>
      • HashMap<String, @Nullable Object>
      • null
      "@Nullable Object" of ArrayList/HashMap is also the above Object.
      Parameters:
      parameters - VivJson's codes, JSON values, file paths, variables, a Configuration, parsed statements, a class instance, a class member, or a calling class-method
      • A VivJson's code, a JSON value, or a file path is given as String.
      • Some VivJson's codes, JSON values, file paths, variables, or Parsed objects are given as ArrayList<Object>.
      • Some variables (name/value pairs) are given as HashMap<String, @Nullable Object>.
      • A JSON value is given as Json.
      • Some configurations are given as Config.
      • Some parsed statements that are generated with parse(Object...).
      • A class instance is given as Instance.
      • A class member is given as the array of Object (Object[]).
        For example, new Object[]{"foo", "bar"}, "return(foo.bar)", and "return(foo['bar'])" are equivalent. Refer to makeInstance(Object...).
      • A calling class-method is given as the array of Object (Object[]).
        Its 1st element is the method name as String.
        The following elements are its argument.
        The arguments and the returned value is Boolean, Long, Double, String, ArrayList<@Nullable Object>, HashMap<String, @Nullable Object>, or null. Refer to makeInstance(Object...).
      Returns:
      result and Error message
      • Member's variable value has a result of the given codes or the deserialized JSON object if success, null otherwise.
      • Member's variable errorMessage has "" if success, the error message otherwise.
    • run

      public static Viv.Result run(Object[] parameters, @Nullable Config config)
      Runs VivJson's code or deserialize JSON objects.

      For example,

      
         String[] strings = new String[] {"{a:3,b:2}", "return(a+b)"};
         Viv.Result result = Viv.run(strings, null);
         if (result.errorMessage.isEmpty()) {
           System.out.println((Long) result.value);  // 5
         }
         else {
           System.err.println(result.errorMessage);
         }
      
         // {"a": 3, "b": [2, 1]}
         strings = new String[] {"{\"a\": 3, \"b\": [2, 1]}"};
         result = Viv.run(strings, null);
         if (result.errorMessage.isEmpty()) {
           HashMap<String, @Nullable Object> map =
               (HashMap<String, @Nullable Object>) result.value;
           System.out.println(map.get("a"));  // 3
           ArrayList<@Nullable Object> list =
               (ArrayList<@Nullable Object>) map.get("b");
           System.out.println(list.get(0));  // 2
         }
         else {
           System.err.println(result.errorMessage);
         }
       

      Two arguments are needed. 1st argument is an array of Objects as below. 2nd argument is configuration. null is given as 2nd argument if configuration is not needed.

      
         - String[] statements =
               new String[] {"x=", "+", "{a:3,b:2}", "return(x.a+x.b)"};
           Viv.run(statements, null);
         - String[] statements = new String[] {"test.viv"};
           Viv.run(statements, null);
         - String[] statements = new String[] {"data.json", "calc.viv"};
           Viv.run(statements, null);
         - Object[] statements = new Object[] {new Viv.Json("{a:3,b:2}"),
                                               "calc.viv"};
           Viv.run(statements, null);
         - ArrayList<Integer> array = new ArrayList<>();
           array.add(1); array.add(2);
           HashMap<String, Object> data = new HashMap<>();
           data.put("x", array); data.put("y", true);  // {"x":[1,2],"y":true}
           Object[] objects = new Object[] {data,
                                        "return(if(y){:=x[0]}else{:=x[1]})"};
           Viv.run(objects, null);
         - String[] statements = new String[] {"x/"};
           Config config = new Config(); config.enableStderr();
           Viv.run(statements, config);  // Error
       

      The above examples are suitable if running times is only one. Otherwise, running after parsing is suitable. Parsing is done with parse(Object[], Config). Then the parsed statement is given as the argument of this method.

      
         String[] statements = new String[] {"a*=10,b+=1", "return(a+b)"};
         Viv.Parsed parsed = Viv.parse(statements, null);
      
         Object[] objects = new Object[] {"{a:3,b:2}", parsed};
         Viv.Result result = Viv.run(objects, null);
         System.out.println((Long) result.value);  // 33
      
         HashMap<String, Integer> variables = new HashMap<>();
         variables.put("a", 5);
         variables.put("b", 7);
         objects[0] = variables;
         result = Viv.run(objects, null);
         System.out.println((Long) result.value);  // 58
      
         variables.replace("b", 10);
         result = Viv.run(objects, null);
         System.out.println((Long) result.value);  // 61
       
      Alternatively, makeInstance(Object[], Config) is suitable. The example is described in the description of makeInstance(Object[], Config).

      Note that the returned value is the following Java's Object.

      • Boolean
      • Long
      • Double
      • String
      • ArrayList<@Nullable Object>
      • HashMap<String, @Nullable Object>
      • null
      @Nullable Object of ArrayList/HashMap is also the above Object.
      Parameters:
      parameters - VivJson's codes, JSON values, file paths, variables, parsed statements, a class instance, a class member, or a calling class-method
      • A VivJson's code, a JSON value, or a file path is given as String.
      • Some VivJson's codes, JSON values, file paths, variables, or Parsed objects are given as ArrayList<Object>.
      • Some variables (name/value pairs) are given as HashMap<String, @Nullable Object>.
      • A JSON value is given as Json.
      • Some parsed statements that are generated with parse(Object[], Config).
      • A class instance is given as Instance.
      • A class member is given as the array of Object (Object[]).
        For example, new Object[]{"foo", "bar"}, "return(foo.bar)", and "return(foo['bar'])" are equivalent. Refer to makeInstance(Object[], Config).
      • A calling class-method is given as the array of Object (Object[]).
        Its 1st element is the method name as String.
        The following elements are its argument.
        The arguments and the returned value is Boolean, Long, Double, String, ArrayList<@Nullable Object>, HashMap<String, @Nullable Object>, or null. Refer to makeInstance(Object[], Config).
      config - configuration if it is needed, null otherwise
      Returns:
      result and Error message
      • Member's variable value has a result of the given codes or the deserialized JSON object if success, null otherwise.
      • Member's variable errorMessage has "" if success, the error message otherwise.
    • runEx

      public static @Nullable Object runEx(Object... parameters) throws VivException
      Runs VivJson's code or deserialize JSON objects. (Permit exception)

      For example,

      
         try {
           Object result = Viv.runEx("a:3,b:2,return(a+b)");
           System.out.println((Long) result);  // 5
         } catch (VivException e) {
           System.err.println(e.getMessage());
         }
      
         try {
           // {"a": 3, "b": [2, 1]}
           Object result = Viv.runEx("{\"a\": 3, \"b\": [2, 1]}");
           HashMap<String, @Nullable Object> map =
               (HashMap<String, @Nullable Object>) result;
           System.out.println(map.get("a"));  // 3
           ArrayList<@Nullable Object> list =
               (ArrayList<@Nullable Object>) map.get("b");
           System.out.println(list.get(0));  // 2
         } catch (VivException e) {
           System.err.println(e.getMessage());
         }
       

      The detail of the argument and the returned value is described in run(Object...).

      parseEx(Object...) or makeInstanceEx(Object...) may be useful if you access member's value/method sometimes.

      Parameters:
      parameters - VivJson's codes, JSON values, file paths, variables, a Configuration, parsed statements, a class instance, a class member, or a calling class-method
      • A VivJson's code, a JSON value, or a file path is given as String.
      • Some VivJson's codes, JSON values, file paths, variables, or Parsed objects are given as ArrayList<Object>.
      • Some variables (name/value pairs) are given as HashMap<String, @Nullable Object>.
      • A JSON value is given as Json.
      • a configuration is given as Config.
      • Some parsed statements that are generated with parseEx(Object...).
      • A class instance is given as Instance.
      • A class member is given as the array of Object (Object[]).
        For example, new Object[]{"foo", "bar"}, "return(foo.bar)", and "return(foo['bar'])" are equivalent. Refer to makeInstanceEx(Object...).
      • A calling class-method is given as the array of Object (Object[]).
        Its 1st element is the method name as String.
        The following elements are its argument.
        The arguments and the returned value is Boolean, Long, Double, String, ArrayList<@Nullable Object>, HashMap<String, @Nullable Object>, or null. Refer to makeInstanceEx(Object...).
      Returns:
      a result of the given codes if success, null otherwise
      Throws:
      VivException - it is thrown if parsing or evaluation is failed.
    • runEx

      public static @Nullable Object runEx(Object[] parameters, @Nullable Config config) throws VivException
      Runs VivJson's code or deserialize JSON objects. (Permit exception)

      For example,

      
         String[] strings = new String[] {"{a:3,b:2}", "return(a+b)"};
         try {
           Object result = Viv.runEx(strings, null);
           System.out.println((Long) result);  // 5
         } catch (VivException e) {
           System.err.println(e.getMessage());
         }
      
         // {"a": 3, "b": [2, 1]}
         strings = new String[] {"{\"a\": 3, \"b\": [2, 1]}"};
         try {
           Object result = Viv.runEx(strings, null);
           HashMap<String, @Nullable Object> map =
               (HashMap<String, @Nullable Object>) result;
           System.out.println(map.get("a"));  // 3
           ArrayList<@Nullable Object> list =
               (ArrayList<@Nullable Object>) map.get("b");
           System.out.println(list.get(0));  // 2
         } catch (VivException e) {
           System.err.println(e.getMessage());
         }
       

      The detail of the argument and the returned value is described in run(Object[], Config).

      parseEx(Object[], Config) or makeInstanceEx(Object[], Config) may be useful if you access member's value/method sometimes.

      Parameters:
      parameters - VivJson's codes, JSON values, file paths, variables, parsed statements, a class instance, a class member, or a calling class-method
      • A VivJson's code, a JSON value, or a file path is given as String.
      • Some VivJson's codes, JSON values, file paths, variables, or Parsed objects are given as ArrayList<Object>.
      • Some variables (name/value pairs) are given as HashMap<String, @Nullable Object>.
      • A JSON value is given as Json.
      • Some parsed statements that are generated with parseEx(Object[], Config).
      • A class instance is given as Instance.
      • A class member is given as the array of Object (Object[]).
        For example, new Object[]{"foo", "bar"}, "return(foo.bar)", and "return(foo['bar'])" are equivalent. Refer to makeInstanceEx(Object[], Config).
      • A calling class-method is given as the array of Object (Object[]).
        Its 1st element is the method name as String.
        The following elements are its argument.
        The arguments and the returned value is Boolean, Long, Double, String, ArrayList<@Nullable Object>, HashMap<String, @Nullable Object>, or null. Refer to makeInstanceEx(Object[], Config).
      config - configuration if it is needed, null otherwise
      Returns:
      a result of the given codes if success, null otherwise
      Throws:
      VivException - it is thrown if parsing or evaluation is failed.
    • parse

      public static Viv.Parsed parse(Object... parameters)
      Parses VivJson's code and JSON object.

      For example,

      
         Viv.Parsed parsed = Viv.parse("return(a+b)");
      
         Viv.Result result = Viv.run("{a:3,b:2}", parsed);
         System.out.println((Long) result.value);  // 5
       

      Multiple arguments can be accepted as below.

      
         - Viv.parse("x=", "+", "{a:3,b:2}", "return(x.a+x.b)");
         - Viv.parse("test.viv");
         - Viv.parse("data.json", "calc.viv");
         - Viv.parse(new Viv.Json("{a:3,b:2}"), "calc.viv");
         - ArrayList<Integer> array = new ArrayList<>();
           array.add(1); array.add(2);
           HashMap<String, Object> data = new HashMap<>();
           data.put("x", array); data.put("y", true);  // {"x":[1,2],"y":true}
           Viv.parse(data,"return(if(y){:=x[0]}else{:=x[1]})");
         - Config config = new Config(); config.enableStderr();
           Viv.parse("x/", config);  // Error
       
      Parameters:
      parameters - VivJson's codes, JSON values, file paths, variables, a Configuration, parsed statements, a class instance, a class member, or a calling class-method
      • A VivJson's code, a JSON value, or a file path is given as String.
      • Some VivJson's codes, JSON values, file paths, variables, or Parsed objects are given as ArrayList<Object>.
      • Some variables (name/value pairs) are given as HashMap<String, @Nullable Object>.
      • A JSON value is given as Json.
      • Some configurations are given as Config.
      • Some parsed statements (Parsed) that are generated with this method. It is passed through toward output.
      • A class instance (Instance) that is generated with makeInstance(Object...). It is passed through toward output.
      • A class member is given as the array of Object (Object[]).
        For example, new Object[]{"foo", "bar"}, "return(foo.bar)", and "return(foo['bar'])" are equivalent. Refer to makeInstance(Object...).
      • A calling class-method is given as the array of Object (Object[]).
        Its 1st element is the method name as String.
        The following elements are its argument.
        The arguments and the returned value is Boolean, Long, Double, String, ArrayList<@Nullable Object>, HashMap<String, @Nullable Object>, or null. Refer to makeInstance(Object...).
      Returns:
      statements of script and Error message
      • Member's variable statements has statements of the given codes if success, null otherwise.
      • Member's variable errorMessage has "" if success, the error message otherwise.
    • parse

      public static Viv.Parsed parse(Object[] parameters, @Nullable Config config)
      Parses VivJson's code and JSON object.

      For example,

      
         String[] statements = new String[] {"a*=10,b+=1", "return(a+b)"};
         Viv.Parsed parsed = Viv.parse(statements, null);
         {
           Viv.Result result = Viv.run("{a:3,b:2}", parsed);
           System.out.println((Long) result.value);  // 33
         }
         {
           Object[] objects = new Object[] {"{a:3,b:2}", parsed};
           Viv.Result result = Viv.run(objects, null);
           System.out.println((Long) result.value);  // 33
         }
       

      Two arguments are needed. 1st argument is an array of Objects as below. 2nd argument is configuration. null is given as 2nd argument if configuration is not needed.
      For example,

      
         - String[] statements = new String[] {"{a:3,b:2}", "{return(a+b)}"};
           Viv.parse(statements, null);
         - String[] statements = new String[] {"x=", "+", "{a:3,b:2}",
                                               "return(x.a+x.b)"};
           Viv.parse(statements, null);
         - String[] statements = new String[] {"test.viv"};
           Viv.parse(statements, null);
         - String[] statements = new String[] {"data.json", "calc.viv"};
           Viv.parse(statements, null);
         - Object[] statements = new Object[] {new Viv.Json("{a:3,b:2}"),
                                               "calc.viv"};
           Viv.parse(statements, null);
         - ArrayList<Integer> array = new ArrayList<>();
           array.add(1); array.add(2);
           HashMap<String, Object> data = new HashMap<>();
           data.put("x", array); data.put("y", true);  // {"x":[1,2],"y":true}
           Object[] objects = new Object[] {data,
                                            "return(if(y){:=x[0]}else{:=x[1]})"};
           Viv.parse(objects, null);
         - String[] statements = new String[] {"x/"};
           Config config = new Config(); config.enableStderr();
           Viv.parse(statements, config);  // Error
       
      Parameters:
      parameters - VivJson's codes, JSON values, file paths, variables, parsed statements, a class instance, a class member, or a calling class-method
      • A VivJson's code, a JSON value, or a file path is given as String.
      • Some VivJson's codes, JSON values, file paths, variables, or Parsed objects are given as ArrayList<Object>.
      • Some variables (name/value pairs) are given as HashMap<String, @Nullable Object>.
      • A JSON value is given as Json.
      • Some parsed statements (Parsed) that are generated with this method. It is passed through toward output.
      • A class instance (Instance) that is generated with makeInstance(Object[], Config). It is passed through toward output.
      • A class member is given as the array of Object (Object[]).
        For example, new Object[]{"foo", "bar"}, "return(foo.bar)", and "return(foo['bar'])" are equivalent. Refer to makeInstance(Object[], Config).
      • A calling class-method is given as the array of Object (Object[]).
        Its 1st element is the method name as String.
        The following elements are its argument.
        The arguments and the returned value is Boolean, Long, Double, String, ArrayList<@Nullable Object>, HashMap<String, @Nullable Object>, or null. Refer to makeInstance(Object[], Config).
      config - configuration if it is needed, null otherwise
      Returns:
      statements of script and Error message
      • Member's variable statements has statements of the given codes if success, null otherwise.
      • Member's variable errorMessage has "" if success, the error message otherwise.
    • parseEx

      public static Viv.Parsed parseEx(Object... parameters) throws VivException
      Parses VivJson's code and JSON object. (Permit exception)

      For example,

      
         try {
           Viv.Parsed parsed = Viv.parseEx("return(a+b)");
       
           Object result = Viv.runEx("{a:3,b:2}", parsed);
           System.out.println((Long) result);  // 5
         } catch (VivException e) {
           System.err.println(e.getMessage());
         }
       

      The detail of the argument and the returned value is described in parse(Object...).

      Parameters:
      parameters - VivJson's codes, JSON values, file paths, variables, a Configuration, parsed statements, a class instance, a class member, or a calling class-method
      • A VivJson's code, a JSON value, or a file path is given as String.
      • Some VivJson's codes, JSON values, file paths, variables, or Parsed objects are given as ArrayList<Object>.
      • Some variables (name/value pairs) are given as HashMap<String, @Nullable Object>.
      • A JSON value is given as Json.
      • Some configurations are given as Config.
      • Some parsed statements (Parsed) that are generated with this method. It is passed through toward output.
      • A class instance (Instance) that is generated with makeInstanceEx(Object...). It is passed through toward output.
      • A class member is given as the array of Object (Object[]).
        For example, new Object[]{"foo", "bar"}, "return(foo.bar)", and "return(foo['bar'])" are equivalent. Refer to makeInstanceEx(Object...).
      • A calling class-method is given as the array of Object (Object[]).
        Its 1st element is the method name as String.
        The following elements are its argument.
        The arguments and the returned value is Boolean, Long, Double, String, ArrayList<@Nullable Object>, HashMap<String, @Nullable Object>, or null. Refer to makeInstanceEx(Object...).
      Returns:
      statements of script and Error message
      • Member's variable statements has statements of the given codes if success, null otherwise.
      • Member's variable errorMessage has "" if success, the error message otherwise.
      Throws:
      VivException - it is thrown if parsing is failed.
    • parseEx

      public static Viv.Parsed parseEx(Object[] parameters, @Nullable Config config) throws VivException
      Parses VivJson's code and JSON object. (Permit exception)

      For example,

      
         String[] statements = new String[] {"a*=10,b+=1", "return(a+b)"};
         try {
           Viv.Parsed parsed = Viv.parseEx(statements, null);
      
             {
               Object result = Viv.runEx("{a:3,b:2}", parsed);
               System.out.println((Long) result);  // 33
             }
             {
               Object[] objects = new Object[] {"{a:3,b:2}", parsed};
               Object result = Viv.runEx(objects, null);
               System.out.println((Long) result);  // 33
             }
         } catch (VivException e) {
           System.err.println(e.getMessage());
         }
       

      The detail of the argument and the returned value is described in parse(Object[], Config).

      Parameters:
      parameters - VivJson's codes, JSON values, file paths, variables, parsed statements, a class instance, a class member, or a calling class-method
      • A VivJson's code, a JSON value, or a file path is given as String.
      • Some VivJson's codes, JSON values, file paths, variables, or Parsed objects are given as ArrayList<Object>.
      • Some variables (name/value pairs) are given as HashMap<String, @Nullable Object>.
      • A JSON value is given as Json.
      • Some parsed statements (Parsed) that are generated with this method. It is passed through toward output.
      • A class instance (Instance) that is generated with makeInstanceEx(Object[], Config). It is passed through toward output.
      • A class member is given as the array of Object (Object[]).
        For example, new Object[]{"foo", "bar"}, "return(foo.bar)", and "return(foo['bar'])" are equivalent. Refer to makeInstanceEx(Object[], Config).
      • A calling class-method is given as the array of Object (Object[]).
        Its 1st element is the method name as String.
        The following elements are its argument.
        The arguments and the returned value is Boolean, Long, Double, String, ArrayList<@Nullable Object>, HashMap<String, @Nullable Object>, or null. Refer to makeInstanceEx(Object[], Config).
      config - configuration if it is needed, null otherwise
      Returns:
      statements of script and Error message
      • Member's variable statements has statements of the given codes if success, null otherwise.
      • Member's variable errorMessage has "" if success, the error message otherwise.
      Throws:
      VivException - it is thrown if parsing is failed.
    • parseFile

      public static Viv.Parsed parseFile(String filePath, @Nullable Config config)
      Parse a file that contains VivJson's code or JSON object. When the file extension is "json", only JSON value is allowed as contents.
      Parameters:
      filePath - the path of file that has VivJson's code or JSON object
      config - configuration if needed, null otherwise
      Returns:
      statements of script and Error message
      • Member's variable statements has statements of the given codes if success, null otherwise.
      • Member's variable errorMessage has "" if success, the error message otherwise.
    • parseFileEx

      public static Viv.Parsed parseFileEx(String filePath, @Nullable Config config) throws VivException
      Parse a file that contains VivJson's code or JSON object. (Permit exception)
      Parameters:
      filePath - the path of file that has VivJson's code or JSON object
      config - configuration if needed, null otherwise
      Returns:
      statements of script and Error message
      • Member's variable statements has statements of the given codes if success, null otherwise.
      • Member's variable errorMessage has "" if success, the error message otherwise.
      Throws:
      VivException - it is thrown if parsing is failed.
    • parseText

      public static Viv.Parsed parseText(String text, @Nullable Config config)
      Parses a text that is VivJson's code or JSON object.
      Parameters:
      text - text that is VivJson's code or JSON object
      config - configuration if needed, null otherwise
      Returns:
      statements of script and Error message
      • Member's variable statements has statements of the given codes if success, null otherwise.
      • Member's variable errorMessage has "" if success, the error message otherwise.
    • parseTextEx

      public static Viv.Parsed parseTextEx(String text, @Nullable Config config) throws VivException
      Parses a text that is VivJson's code or JSON object. (Permit exception)
      Parameters:
      text - text that is VivJson's code or JSON object
      config - configuration if needed, null otherwise
      Returns:
      statements of script and Error message
      • Member's variable statements has statements of the given codes if success, null otherwise.
      • Member's variable errorMessage has "" if success, the error message otherwise.
      Throws:
      VivException - it is thrown if parsing is failed.
    • makeInstance

      public static Viv.Instance makeInstance(Object... parameters)
      Makes a class instance. This method runs the given parameters as Constructor. Then its result will be class instance.

      For example, JSON object's member is extracted as below.

      
         // {"a": [10, {"b": null, "c": "test"}], "d": {"e": 3.5}}
         Viv.Instance instance = Viv.makeInstance(
           "{\"a\": [10, {\"b\": null, \"c\": \"test\"}], \"d\": {\"e\": 3.5}}");
         try {
           System.out.println(
             Viv.runEx(instance, new Object[]{"a",1,"c"}));  // "test"
           System.out.println(
             Viv.runEx(instance, "return(d.e)"));  // 3.5
         } catch (VivException e) {
           System.err.println(e.getMessage());
         }
       
      new Object[]{"foo", "bar"}, "return(foo.bar)", and "return(foo['bar'])" are equivalent.
      The valid element of the above Object's array is integer or String. The each hierarchy of JSON object/array is decomposed into the array.

      Array, boolean, number, or string can be accessed via the implicit variable "_".

      
         Viv.Instance instance = Viv.makeInstance("100");
         try {
           System.out.println(Viv.runEx(instance, new Object[]{"_"})); // 100
           System.out.println(Viv.runEx(instance, "return(_)")); // 100
         } catch (VivException e) {
           System.err.println(e.getMessage());
         }
       
      When there are some values, _[0], _[1], ... are assigned.
      
         // true, false, null, "text", 100L, 1.0
         Viv.Instance instance = Viv.makeInstance(
                     "true", "false", "null", "text", "100", "1.0");
         try {
           Object[] variable = new Object[] {"_", null};
           for (int i = 0; i < 6; i++) {
             variable[1] = i;
             System.out.println(Viv.runEx(instance, variable));
             System.out.println(Viv.runEx(instance, "return(_[" + i + "])"));
           }
         } catch (VivException e) {
           System.err.println(e.getMessage());
         }
       
      
         // ["a", 10, [{"b": null, "c": "test"}, false]]
         Viv.Instance instance = Viv.makeInstance(
                 "[\"a\", 10, [{\"b\": null, \"c\": \"test\"}, false]]");
         try {
           System.out.println(
             Viv.runEx(instance, new Object[]{"_", 2, 0, "b"}));  // null
           System.out.println(
             Viv.runEx(instance, "return(_[2][0]['b'])"));  // null
           System.out.println(
             Viv.runEx(instance, new Object[]{"_", 2, -2, "c"}));  // "test"
           System.out.println(
             Viv.runEx(instance, "return(_.2.-2.c)"));  // "test"
         } catch (VivException e) {
           System.err.println(e.getMessage());
         }
       
      Note that the negative index is used for backward access in array.

      When whole extracted value is needed, Viv.run or Viv.runEx is used without this method.

      
         try {
           // {"a": [10, {"b": null, "c": "test"}], "d": {"e": 3.5}}
           Object result = Viv.runEx(
             "{\"a\": [10, {\"b\": null, \"c\": \"test\"}], \"d\": {\"e\": 3.5}}");
           HashMap<String, @Nullable Object> value =
             (HashMap<String, @Nullable Object>) result;
           ArrayList<@Nullable Object> array =
             (ArrayList<@Nullable Object>) value.get("a");
           System.out.println(array.get(0));  // 10
         } catch (VivException e) {
           System.err.println(e.getMessage());
         }
       

      Note that the returned value is the following Java's Object.

      • Boolean
      • Long
      • Double
      • String
      • ArrayList<@Nullable Object>
      • HashMap<String, @Nullable Object>
      • null
      "@Nullable Object" of ArrayList/HashMap is also the above Object.

      The above "return()", the following "c = a * b, return(c)", and so on are the additional anonymous function.

      
         // {"a": 3, "b": 2}
         Viv.Instance instance = Viv.makeInstance("{\"a\": 3, \"b\": 2}");
         try {
           System.out.println(Viv.runEx(instance, "return(a)"));  // 3
           System.out.println(Viv.runEx(instance, "return(a + b)"));  // 5
           // Local variable "c" is created. However it is lost after running task.
           System.out.println(Viv.runEx(instance, "c = a * b, return(c)"));  // 6
           System.out.println(Viv.runEx(instance, "return(c)"));  // null ("c" is missing.)
           // Class member "a" is rewritten. So it is remained after running task.
           System.out.println(Viv.runEx(instance, "a += 100, return(a)"));  // 103
           System.out.println(Viv.runEx(instance, "return(a)"));  // 103
         } catch (VivException e) {
           System.err.println(e.getMessage());
         }
       

      The class-method can be called as below.

      
          String code = "function test(x, y) {"
                      + "  z = x.a + x.b.1 + y"
                      + "  return(z)"
                      + "}";
          // {"a": 100, "b": [1.0, 2.0]}
          ArrayList<Double> list = new ArrayList<>();
          list.add(1.0);
          list.add(2.0);
          HashMap<String, Object> map = new HashMap<>();
          map.put("a", 100);
          map.put("b", list);
      
          Viv.Instance instance = Viv.makeInstance(code);
          try {
            Object result = Viv.runEx(instance, new Object[] {"test", map, 3});
            System.out.println(result);  // 105.0
          } catch (VivException e) {
            System.err.println(e.getMessage());
          }
       
      The 1st element of the given array is the method name as String.
      The following elements are its argument.
      The arguments and the returned value is the above Java's Object.
      In arguments of run(Object...) and runEx(Object...), instance object must be given before the array of Object (Object[]).
      Parameters:
      parameters - VivJson's codes, JSON values, file paths, variables, a Configuration, or the parsed statement
      • A VivJson's code, a JSON value, or a file path is given as String.
      • Some VivJson's codes, JSON values, file paths, variables, or Parsed objects are given as ArrayList<Object>.
      • Some variables (name/value pairs) are given as HashMap<String, @Nullable Object>.
      • A JSON value is given as Json.
      • Configuration is given as Config.
      • The parsed statement that is generated with parse(Object...).
      Even if the class instance is contained, it is ignored.
      Returns:
      a class instance and Error message
      • Member's variable evaluator has a class instance if success, null otherwise.
      • Member's variable errorMessage has "" if success, the error message otherwise.
    • makeInstance

      public static Viv.Instance makeInstance(Object[] parameters, @Nullable Config config)
      Makes a class instance. This method runs the given parameters as Constructor. Then its result will be class instance.

      For example, JSON object's member is extracted as below.

      
         // {"a": [10, {"b": null, "c": "test"}], "d": {"e": 3.5}}
         String[] strings = new String[] {
           "{\"a\": [10, {\"b\": null, \"c\": \"test\"}], \"d\": {\"e\": 3.5}}"};
         Viv.Instance instance = Viv.makeInstance(strings, null);
         try {
           System.out.println(
             Viv.runEx(instance, new Object[]{"a",1,"c"}));  // "test"
           System.out.println(
             Viv.runEx(instance, "return(d.e)"));  // 3.5
         } catch (VivException e) {
           System.err.println(e.getMessage());
         }
       
      new Object[]{"foo", "bar"}, "return(foo.bar)", and "return(foo['bar'])" are equivalent.
      The valid element of the above Object's array is integer or String. The each hierarchy of JSON object/array is decomposed into the array.

      Array, boolean, number, or string can be accessed via the implicit variable "_".

      
         String[] strings = new String[] {"100"};
         Viv.Instance instance = Viv.makeInstance(strings, null);
         try {
           System.out.println(Viv.runEx(instance, new Object[]{"_"})); // 100
           System.out.println(Viv.runEx(instance, "return(_)")); // 100
         } catch (VivException e) {
           System.err.println(e.getMessage());
         }
       
      When there are some values, _[0], _[1], ... are assigned.
      
         // true, false, null, "text", 100L, 1.0
         String[] strings =
                 new String[] {"true", "false", "null", "text", "100", "1.0"};
         Viv.Instance instance = Viv.makeInstance(strings, null);
         try {
           Object[] variable = new Object[] {"_", null};
           for (int i = 0; i < 6; i++) {
             variable[1] = i;
             System.out.println(Viv.runEx(instance, variable));
             System.out.println(Viv.runEx(instance, "return(_[" + i + "])"));
           }
         } catch (VivException e) {
           System.err.println(e.getMessage());
         }
       
      
         // ["a", 10, [{"b": null, "c": "test"}, false]]
         String[] strings =
             new String[] {"[\"a\", 10, [{\"b\": null, \"c\": \"test\"}, false]]"};
         Viv.Instance instance = Viv.makeInstance(strings, null);
         try {
           System.out.println(
             Viv.runEx(instance, new Object[]{"_", 2, 0, "b"}));  // null
           System.out.println(
             Viv.runEx(instance, "return(_[2][0]['b'])"));  // null
           System.out.println(
             Viv.runEx(instance, new Object[]{"_", 2, -2, "c"}));  // "test"
           System.out.println(
             Viv.runEx(instance, "return(_.2.-2.c)"));  // "test"
         } catch (VivException e) {
           System.err.println(e.getMessage());
         }
       
      Note that the negative index is used for backward access in array.

      When whole extracted value is needed, Viv.run or Viv.runEx is used without this method.

      
         // {"a": [10, {"b": null, "c": "test"}], "d": {"e": 3.5}}
         String[] strings = new String[] {
           "{\"a\": [10, {\"b\": null, \"c\": \"test\"}], \"d\": {\"e\": 3.5}}"};
         try {
           Object result = Viv.runEx(strings, null);
           HashMap<String, @Nullable Object> value =
             (HashMap<String, @Nullable Object>) result;
           ArrayList<@Nullable Object> array =
             (ArrayList<@Nullable Object>) value.get("a");
           System.out.println(array.get(0));  // 10
         } catch (VivException e) {
           System.err.println(e.getMessage());
         }
       

      Note that the returned value is the following Java's Object.

      • Boolean
      • Long
      • Double
      • String
      • ArrayList<@Nullable Object>
      • HashMap<String, @Nullable Object>
      • null
      "@Nullable Object" of ArrayList/HashMap is also the above Object.

      The above "return()", the following "c = a * b, return(c)", and so on are the additional anonymous function.

      
         // {"a": 3, "b": 2}
         String[] strings = new String[] {"{\"a\": 3, \"b\": 2}"};
         Viv.Instance instance = Viv.makeInstance(strings, null);
         try {
           System.out.println(Viv.runEx(instance, "return(a)"));  // 3
           System.out.println(Viv.runEx(instance, "return(a + b)"));  // 5
           // Local variable "c" is created. However it is lost after running task.
           System.out.println(Viv.runEx(instance, "c = a * b, return(c)"));  // 6
           System.out.println(Viv.runEx(instance, "return(c)"));  // null ("c" is missing.)
           // Class member "a" is rewritten. So it is remained after running task.
           System.out.println(Viv.runEx(instance, "a += 100, return(a)"));  // 103
           System.out.println(Viv.runEx(instance, "return(a)"));  // 103
         } catch (VivException e) {
           System.err.println(e.getMessage());
         }
       

      The class-method can be called as below.

      
          String[] codes = new String[] {
            "function add3(x, y, z) {return(x + y + z)}",
            "function test(x, y) {return(add3(x.a, x.b.1, y))}"
          };
          // {"a": 100, "b": [1.0, 2.0]}
          ArrayList<Double> list = new ArrayList<>();
          list.add(1.0);
          list.add(2.0);
          HashMap<String, Object> map = new HashMap<>();
          map.put("a", 100);
          map.put("b", list);
      
          Viv.Instance instance = Viv.makeInstance(codes, null);
          try {
            Object result = Viv.runEx(instance, new Object[] {"test", map, 3});
            System.out.println(result);  // 105.0
          } catch (VivException e) {
            System.err.println(e.getMessage());
          }
       
      The 1st element of the given array is the method name as String.
      The following elements are its argument.
      The arguments and the returned value is the above Java's Object.
      In arguments of run(Object[], Config) and run(Object[], Config), instance object must be given before the array of Object (Object[]).
      Parameters:
      parameters - VivJson's codes, JSON values, file paths, variables, or the parsed statement
      • A VivJson's code, a JSON value, or a file path is given as String.
      • Some VivJson's codes, JSON values, file paths, variables, or Parsed objects are given as ArrayList<Object>.
      • Some variables (name/value pairs) are given as HashMap<String, @Nullable Object>.
      • A JSON value is given as Json.
      • The parsed statement that is generated with parse(Object[], Config).
      Even if the class instance is contained, it is ignored.
      config - configuration if needed, null otherwise
      Returns:
      a class instance and Error message
      • Member's variable evaluator has a class instance if success, null otherwise.
      • Member's variable errorMessage has "" if success, the error message otherwise.
    • makeInstanceEx

      public static Viv.Instance makeInstanceEx(Object... parameters) throws VivException
      Makes a class instance. (Permit exception) This method runs the given parameters as Constructor. Then its result will be class instance.

      For example, JSON object's member is extracted as below.

      
         try {
           // {"a": [10, {"b": null, "c": "test"}], "d": {"e": 3.5}}
           Viv.Instance instance = Viv.makeInstanceEx(
             "{\"a\": [10, {\"b\": null, \"c\": \"test\"}], \"d\": {\"e\": 3.5}}");
           System.out.println(
             Viv.runEx(instance, new Object[]{"a",1,"c"}));  // "test"
           System.out.println(
             Viv.runEx(instance, "return(d.e)"));  // 3.5
         } catch (VivException e) {
           System.err.println(e.getMessage());
         }
       
      new Object[]{"foo", "bar"}, "return(foo.bar)", and "return(foo['bar'])" are equivalent.
      The valid element of the above Object's array is integer or String. The each hierarchy of JSON object/array is decomposed into the array.

      The class-method can be called as below.

      
          String code = "function test(x, y) {"
                      + "  z = x.a + x.b.1 + y"
                      + "  return(z)"
                      + "}";
          // {"a": 100, "b": [1.0, 2.0]}
          ArrayList<Double> list = new ArrayList<>();
          list.add(1.0);
          list.add(2.0);
          HashMap<String, Object> map = new HashMap<>();
          map.put("a", 100);
          map.put("b", list);
      
          try {
            Viv.Instance instance = Viv.makeInstanceEx(code);
            Object result = Viv.runEx(instance, new Object[] {"test", map, 3});
            System.out.println(result);  // 105.0
          } catch (VivException e) {
            System.err.println(e.getMessage());
          }
       
      The 1st element of the given array is the method name as String.
      The following elements are its argument.
      The arguments and the returned value is the above Java's Object.
      In arguments of run(Object...) and runEx(Object...), instance object must be given before the array of Object (Object[]).

      The detail of the argument and the returned value is described in makeInstance(Object...).

      Parameters:
      parameters - VivJson's codes, JSON values, file paths, variables, a Configuration, or the parsed statement
      • A VivJson's code, a JSON value, or a file path is given as String.
      • Some VivJson's codes, JSON values, file paths, variables, or Parsed objects are given as ArrayList<Object>.
      • Some variables (name/value pairs) are given as HashMap<String, @Nullable Object>.
      • A JSON value is given as Json.
      • Configuration is given as Config.
      • The parsed statement that is generated with parse(Object...).
      Even if the class instance is contained, it is ignored.
      Returns:
      a class instance and Error message
      • Member's variable evaluator has a class instance if success, null otherwise.
      • Member's variable errorMessage has "" if success, the error message otherwise.
      Throws:
      VivException - it is thrown if making is failed.
    • makeInstanceEx

      public static Viv.Instance makeInstanceEx(Object[] parameters, @Nullable Config config) throws VivException
      Makes a class instance. (Permit exception) This method runs the given parameters as Constructor. Then its result will be class instance.

      For example, JSON object's member is extracted as below.

      
         // {"a": [10, {"b": null, "c": "test"}], "d": {"e": 3.5}}
         String[] strings = new String[] {
           "{\"a\": [10, {\"b\": null, \"c\": \"test\"}], \"d\": {\"e\": 3.5}}"};
         try {
           Viv.Instance instance = Viv.makeInstanceEx(strings, null);
           System.out.println(
             Viv.runEx(instance, new Object[]{"a",1,"c"}));  // "test"
           System.out.println(
             Viv.runEx(instance, "return(d.e)"));  // 3.5
         } catch (VivException e) {
           System.err.println(e.getMessage());
         }
       
      new Object[]{"foo", "bar"}, "return(foo.bar)", and "return(foo['bar'])" are equivalent.
      The valid element of the above Object's array is integer or String. The each hierarchy of JSON object/array is decomposed into the array.

      The class-method can be called as below.

      
          String[] codes = new String[] {
            "function add3(x, y, z) {return(x + y + z)}",
            "function test(x, y) {return(add3(x.a, x.b.1, y))}"
          };
          // {"a": 100, "b": [1.0, 2.0]}
          ArrayList<Double> list = new ArrayList<>();
          list.add(1.0);
          list.add(2.0);
          HashMap<String, Object> map = new HashMap<>();
          map.put("a", 100);
          map.put("b", list);
      
          try {
            Viv.Instance instance = Viv.makeInstanceEx(codes, null);
            Object result = Viv.runEx(instance, new Object[] {"test", map, 3});
            System.out.println(result);  // 105.0
          } catch (VivException e) {
            System.err.println(e.getMessage());
          }
       
      The 1st element of the given array is the method name as String.
      The following elements are its argument.
      The arguments and the returned value is the above Java's Object..
      In arguments of run(Object[], Config) and run(Object[], Config), instance object must be given before the array of Object (Object[]).

      The detail of the argument and the returned value is described in makeInstance(Object[], Config).

      Parameters:
      parameters - VivJson's codes, JSON values, file paths, variables, or the parsed statement
      • A VivJson's code, a JSON value, or a file path is given as String.
      • Some VivJson's codes, JSON values, file paths, variables, or Parsed objects are given as ArrayList<Object>.
      • Some variables (name/value pairs) are given as HashMap<String, @Nullable Object>.
      • A JSON value is given as Json.
      • The parsed statement that is generated with parse(Object[], Config).
      Even if the class instance is contained, it is ignored.
      config - configuration if needed, null otherwise
      Returns:
      a class instance and Error message
      • Member's variable evaluator has a class instance if success, null otherwise.
      • Member's variable errorMessage has "" if success, the error message otherwise.
      Throws:
      VivException - it is thrown if making is failed.
    • printStatements

      public static void printStatements(Object statements)
      Prints statements.
      Parameters:
      statements - statements of script. Parsed, Block, or ArrayList<Statement>.
    • printStatements

      public static void printStatements(Object statements, boolean addClassName, @Nullable Config config)
      Prints statements.
      Parameters:
      statements - statements of script. Parsed, Block, or ArrayList<Statement>.
      addClassName - Class name is added to each statement if this is true.
      config - configuration if needed, null otherwise
    • getBoolean

      public static @Nullable Boolean getBoolean(@Nullable Object... objects)
      Gets a boolean.

      When the entity of the object is expected as boolean, it can be converted with this method.
      However, if the evaluated result is not boolean, null is returned.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         Boolean src = true;
         Object obj = src;
         // Example
         Boolean value = Viv.getBoolean(obj);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Result result = Viv.run("a=2", "return(a==2)");
         // Example
         Boolean value = Viv.getBoolean(result);
       

      The same arguments of Viv.run and Viv.runEx can be given.

      
         Boolean value = Viv.getBoolean("a=2", "return(a==2)");
       
      Parameters:
      objects - object that may be a boolean value
      Returns:
      a boolean value. null if evaluation is failed or the evaluated result is not boolean.
      See Also:
    • getBoolean

      public static @Nullable Boolean getBoolean(@Nullable Object[] objects, @Nullable Config config)
      Gets a boolean.

      When the entity of the object is expected as boolean, it can be converted with this method.
      However, if the evaluated result is not boolean, null is returned.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - object that may be a boolean value
      config - configuration if it is needed, null otherwise
      Returns:
      a boolean value. null if evaluation is failed or the evaluated result is not boolean.
      See Also:
    • getBooleanEx

      public static boolean getBooleanEx(@Nullable Object... objects) throws VivException
      Gets a boolean. (Permit exception)

      When the entity of the object is expected as boolean, it can be converted with this method.
      However, if the evaluated result is not boolean, the exception is thrown.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         Boolean src = true;
         Object obj = src;
         // Example
         boolean value = Viv.getBooleanEx(obj);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Object object = Viv.runEx("a=2", "return(a==2)");
         // Example
         boolean value = Viv.getBooleanEx(object);
       

      The same arguments of Viv.run and Viv.runEx can be given.

      
         boolean value = Viv.getBooleanEx("a=2", "return(a==2)");
       
      Parameters:
      objects - object that may be a boolean value
      Returns:
      a boolean value
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not boolean.
      See Also:
    • getBooleanEx

      public static boolean getBooleanEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets a boolean. (Permit exception)

      When the entity of the object is expected as boolean, it can be converted with this method.
      However, if the evaluated result is not boolean, the exception is thrown.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - object that may be a boolean value
      config - configuration if it is needed, null otherwise
      Returns:
      a boolean value
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not boolean.
      See Also:
    • getBooleans

      public static boolean @Nullable [] getBooleans(@Nullable Object... objects)
      Gets an array of boolean.

      When the entity of the object is expected as an array of boolean, it can be converted with this method.
      However, if there is invalid element, such as integer, null is returned.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         ArrayList<Object> array = new ArrayList<>();
         array.add(true);
         array.add(false);
         array.add(true);
         // Example
         boolean[] booleans = Viv.getBooleans(array);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Result result = Viv.run("return([true, false])");
         // Example
         boolean[] booleans = Viv.getBooleans(result);
       

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String or value is not boolean, this method returns null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      
         boolean[] booleans = Viv.getBooleans("{\"a\": true, \"b\": false}");
       
      Parameters:
      objects - a value that may be an array or a block
      Returns:
      an array of boolean. null if evaluation is failed or the evaluated result is not an array of boolean.
      See Also:
    • getBooleans

      public static boolean @Nullable [] getBooleans(@Nullable Object[] objects, @Nullable Config config)
      Gets an array of boolean.

      When the entity of the object is expected as an array of boolean, it can be converted with this method.
      However, if there is invalid element, such as integer, null is returned.

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String or value is not boolean, this method returns null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be an array or a block
      config - configuration if it is needed, null otherwise
      Returns:
      an array of boolean. null if evaluation is failed or the evaluated result is not an array of boolean.
      See Also:
    • getBooleansEx

      public static boolean[] getBooleansEx(@Nullable Object... objects) throws VivException
      Gets an array of boolean. (Permit exception)

      When the entity of the object is expected as an array of boolean, it can be converted with this method.
      However, if there is invalid element, such as integer, the exception is thrown.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         ArrayList<Object> array = new ArrayList<>();
         array.add(true);
         array.add(false);
         array.add(true);
         // Example
         boolean[] booleans = Viv.getBooleansEx(array);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Object object = Viv.runEx("return([true, false])");
         // Example
         boolean[] booleans = Viv.getBooleansEx(object);
       

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String or value is not boolean, this method throws the exception.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      
         boolean[] booleans = Viv.getBooleansEx("{\"a\": true, \"b\": false}");
       
      Parameters:
      objects - a value that may be an array or a block
      Returns:
      an array of boolean
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not an array of boolean.
      See Also:
    • getBooleansEx

      public static boolean[] getBooleansEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets an array of boolean. (Permit exception)

      When the entity of the object is expected as an array of boolean, it can be converted with this method.
      However, if there is invalid element, such as integer, the exception is thrown.

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String or value is not boolean, this method throws the exception.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be an array or a block
      config - configuration if it is needed, null otherwise
      Returns:
      an array of boolean
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not an array of boolean.
      See Also:
    • getBooleanOrNulls

      public static @Nullable Boolean @Nullable [] getBooleanOrNulls(@Nullable Object... objects)
      Gets an array of boolean.

      When the entity of the object is expected as an array of boolean, it can be converted with this method.
      Even if there is invalid element, such as integer, it will be replaced with null.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         ArrayList<Object> array = new ArrayList<>();
         array.add(true);
         array.add(0);
         array.add(false);
         // Example
         Boolean[] booleans = Viv.getBooleans(array);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Result result = Viv.run("return([true, 0])");
         // Example
         Boolean[] booleans = Viv.getBooleans(result);
       

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String, this method returns null.
      Even if there is invalid value, such as integer, it will be replaced with null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      
         Boolean[] booleans = Viv.getBooleans("{\"a\": true, \"b\": 0}");
       
      Parameters:
      objects - a value that may be an array or a block
      Returns:
      an array of boolean/null. null if evaluation is failed or the evaluated result is not an array of boolean.
      See Also:
    • getBooleanOrNulls

      public static @Nullable Boolean @Nullable [] getBooleanOrNulls(@Nullable Object[] objects, @Nullable Config config)
      Gets an array of boolean.

      When the entity of the object is expected as an array of boolean, it can be converted with this method.
      Even if there is invalid element, such as integer, it will be replaced with null.

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String, this method returns null.
      Even if there is invalid value, such as integer, it will be replaced with null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be an array or a block
      config - configuration if it is needed, null otherwise
      Returns:
      an array of boolean/null. null if evaluation is failed or the evaluated result is not an array of boolean.
      See Also:
    • getBooleanOrNullsEx

      public static @Nullable Boolean[] getBooleanOrNullsEx(@Nullable Object... objects) throws VivException
      Gets an array of boolean. (Permit exception)

      When the entity of the object is expected as an array of boolean, it can be converted with this method.
      Even if there is invalid element, such as integer, it will be replaced with null.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         ArrayList<Object> array = new ArrayList<>();
         array.add(true);
         array.add(0);
         array.add(false);
         // Example
         Boolean[] booleans = Viv.getBooleanOrNullsEx(array);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Object object = Viv.runEx("return([true, 0])");
         // Example
         Boolean[] booleans = Viv.getBooleanOrNullsEx(object);
       

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String, this method throws the exception.
      Even if there is invalid value, such as integer, it will be replaced with null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      
         Boolean[] booleans = Viv.getBooleanOrNullsEx("{\"a\": true, \"b\": 0}");
       
      Parameters:
      objects - a value that may be an array or a block
      Returns:
      an array of boolean/null
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not an array of boolean.
      See Also:
    • getBooleanOrNullsEx

      public static @Nullable Boolean[] getBooleanOrNullsEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets an array of boolean. (Permit exception)

      When the entity of the object is expected as an array of boolean, it can be converted with this method.
      Even if there is invalid element, such as integer, it will be replaced with null.

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String, this method throws the exception.
      Even if there is invalid value, such as integer, it will be replaced with null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be an array or a block
      config - configuration if it is needed, null otherwise
      Returns:
      an array of boolean/null
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not an array of boolean.
      See Also:
    • getInteger

      public static @Nullable Integer getInteger(@Nullable Object... objects)
      Gets an integer.

      When the entity of the object is expected as number, it can be converted into integer with this method.
      However, if the evaluated result is not integer, null is returned.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         Object obj = 100;
         // Example
         Integer value = Viv.getInteger(obj);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Result result = Viv.run("return(10)");
         // Example
         Integer value = Viv.getInteger(result);
       

      The same arguments of Viv.run and Viv.runEx can be given.

      
         Integer value = Viv.getInteger("return(10)");
       
      Parameters:
      objects - a value that may be number
      Returns:
      an integer value. null if evaluation is failed or the evaluated result is not an array of integer.
      See Also:
    • getInteger

      public static @Nullable Integer getInteger(@Nullable Object[] objects, @Nullable Config config)
      Gets an integer.

      When the entity of the object is expected as number, it can be converted into integer with this method.
      However, if the evaluated result is not integer, null is returned.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be number
      config - configuration if it is needed, null otherwise
      Returns:
      an integer value. null if evaluation is failed or the evaluated result is not an array of integer.
      See Also:
    • getIntegerEx

      public static int getIntegerEx(@Nullable Object... objects) throws VivException
      Gets an integer. (Permit exception)

      When the entity of the object is expected as number, it can be converted into integer with this method.
      However, if the evaluated result is not integer, the exception is thrown.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         Object obj = 100;
         // Example
         int value = Viv.getIntegerEx(obj);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Object object = Viv.runEx("return(10)");
         // Example
         int value = Viv.getIntegerEx(object);
       

      The same arguments of Viv.run and Viv.runEx can be given.

      
         int value = Viv.getIntegerEx("return(10)");
       
      Parameters:
      objects - a value that may be number
      Returns:
      an integer value
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not integer.
      See Also:
    • getIntegerEx

      public static int getIntegerEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets an integer. (Permit exception)

      When the entity of the object is expected as number, it can be converted into integer with this method.
      However, if the evaluated result is not integer, the exception is thrown.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be number
      config - configuration if it is needed, null otherwise
      Returns:
      an integer value
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not integer.
      See Also:
    • getIntegers

      public static int @Nullable [] getIntegers(@Nullable Object... objects)
      Gets an array of integer.

      When the entity of the object is expected as an array of number, it can be converted with this method.
      However, if there is invalid element, such as boolean, null is returned.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         ArrayList<Object> array = new ArrayList<>();
         array.add(1);
         array.add(3);
         array.add(5);
         // Example
         int[] ints = Viv.getIntegers(array);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Result result = Viv.run("return([7, 9])");
         // Example
         int[] ints = Viv.getIntegers(result);
       

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String or value is not number, this method returns null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      
         int[] ints = Viv.getIntegers("return([7, 9])");
       
      Parameters:
      objects - a value that may be an array or a block
      Returns:
      an array of integer. null if evaluation is failed or the evaluated result is not an array of integer.
      See Also:
    • getIntegers

      public static int @Nullable [] getIntegers(@Nullable Object[] objects, @Nullable Config config)
      Gets an array of integer.

      When the entity of the object is expected as an array of number, it can be converted with this method.
      However, if there is invalid element, such as boolean, null is returned.

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String or value is not number, this method returns null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be an array or a block
      config - configuration if it is needed, null otherwise
      Returns:
      an array of integer. null if evaluation is failed or the evaluated result is not an array of integer.
      See Also:
    • getIntegersEx

      public static int[] getIntegersEx(@Nullable Object... objects) throws VivException
      Gets an array of integer. (Permit exception)

      When the entity of the object is expected as an array of number, it can be converted with this method.
      However, if there is invalid element, such as boolean, the exception is thrown.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         ArrayList<Object> array = new ArrayList<>();
         array.add(1);
         array.add(3);
         array.add(5);
         // Example
         int[] ints = Viv.getIntegersEx(array);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Object object = Viv.runEx("return([7, 9])");
         // Example
         int[] ints = Viv.getIntegersEx(object);
       

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String or value is not number, this method throws the exception.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      
         int[] ints = Viv.getIntegersEx("return([7, 9])");
       
      Parameters:
      objects - a value that may be an array or a block
      Returns:
      an array of integer
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not an array of integer.
      See Also:
    • getIntegersEx

      public static int[] getIntegersEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets an array of integer. (Permit exception)

      When the entity of the object is expected as an array of number, it can be converted with this method.
      However, if there is invalid element, such as boolean, the exception is thrown.

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String or value is not number, this method throws the exception.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be an array or a block
      config - configuration if it is needed, null otherwise
      Returns:
      an array of integer
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not an array of integer.
      See Also:
    • getIntegerOrNulls

      public static @Nullable Integer @Nullable [] getIntegerOrNulls(@Nullable Object... objects)
      Gets an array of integer.

      When the entity of the object is expected as an array of number, it can be converted with this method.
      Even if there is invalid element, such as boolean, it will be replaced with null.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         ArrayList<Object> array = new ArrayList<>();
         array.add(1);
         array.add(false);  // --> null
         array.add(5);
         // Example
         Integer[] ints = Viv.getIntegerOrNulls(array);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Result result = Viv.run("return([7, false])");
         // Example
         Integer[] ints = Viv.getIntegerOrNulls(result);
       

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String, this method returns null.
      Even if there is invalid value, such as boolean, it will be replaced with null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      
         Integer[] ints = Viv.getIntegerOrNulls("return([7, false])");
       
      Parameters:
      objects - a value that may be an array or a block
      Returns:
      an array of integer/null. null if evaluation is failed or the evaluated result is not an array of integer.
      See Also:
    • getIntegerOrNulls

      public static @Nullable Integer @Nullable [] getIntegerOrNulls(@Nullable Object[] objects, @Nullable Config config)
      Gets an array of integer.

      When the entity of the object is expected as an array of number, it can be converted with this method.
      Even if there is invalid element, such as boolean, it will be replaced with null.

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String, this method returns null.
      Even if there is invalid value, such as boolean, it will be replaced with null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be an array or a block
      config - configuration if it is needed, null otherwise
      Returns:
      an array of integer/null. null if evaluation is failed or the evaluated result is not an array of integer.
      See Also:
    • getIntegerOrNullsEx

      public static @Nullable Integer[] getIntegerOrNullsEx(@Nullable Object... objects) throws VivException
      Gets an array of integer. (Permit exception)

      When the entity of the object is expected as an array of number, it can be converted with this method.
      Even if there is invalid element, such as boolean, it will be replaced with null.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         ArrayList<Object> array = new ArrayList<>();
         array.add(1);
         array.add(false);  // --> null
         array.add(5);
         // Example
         Integer[] ints = Viv.getIntegerOrNullsEx(array);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Object object = Viv.runEx("return([7, false])");
         // Example
         Integer[] ints = Viv.getIntegerOrNullsEx(object);
       

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String, this method throws the exception.
      Even if there is invalid value, such as boolean, it will be replaced with null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      
         Integer[] ints = Viv.getIntegerOrNullsEx("return([7, false])");
       
      Parameters:
      objects - a value that may be an array or a block
      Returns:
      an array of integer/null
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not an array of integer.
      See Also:
    • getIntegerOrNullsEx

      public static @Nullable Integer[] getIntegerOrNullsEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets an array of integer. (Permit exception)

      When the entity of the object is expected as an array of number, it can be converted with this method.
      Even if there is invalid element, such as boolean, it will be replaced with null.

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String, this method throws the exception.
      Even if there is invalid value, such as boolean, it will be replaced with null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be an array or a block
      config - configuration if it is needed, null otherwise
      Returns:
      an array of integer/null
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not an array of integer.
      See Also:
    • getLong

      public static @Nullable Long getLong(@Nullable Object... objects)
      Gets a long integer.

      When the entity of the object is expected as number, it can be converted into long integer with this method.
      However, if the evaluated result is not long integer, null is returned.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         Object obj = 100;
         // Example
         Long value = Viv.getLong(obj);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Result result = Viv.run("return(10)");
         // Example
         Long value = Viv.getLong(result);
       

      The same arguments of Viv.run and Viv.runEx can be given.

      
         Long value = Viv.getLong("return(10)");
       
      Parameters:
      objects - a value that may be number
      Returns:
      a long integer value. null if evaluation is failed or the evaluated result is not an array of long integer.
      See Also:
    • getLong

      public static @Nullable Long getLong(@Nullable Object[] objects, @Nullable Config config)
      Gets a long integer.

      When the entity of the object is expected as number, it can be converted into long integer with this method.
      However, if the evaluated result is not long integer, null is returned.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be number
      config - configuration if it is needed, null otherwise
      Returns:
      a long integer value. null if evaluation is failed or the evaluated result is not an array of long integer.
      See Also:
    • getLongEx

      public static long getLongEx(@Nullable Object... objects) throws VivException
      Gets a long integer. (Permit exception)

      When the entity of the object is expected as number, it can be converted into long integer with this method.
      However, if the evaluated result is not long integer, the exception is thrown.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         Object obj = 100;
         // Example
         long value = Viv.getLongEx(obj);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Object object = Viv.runEx("return(10)");
         // Example
         long value = Viv.getLongEx(object);
       

      The same arguments of Viv.run and Viv.runEx can be given.

      
         long value = Viv.getLongEx("return(10)");
       
      Parameters:
      objects - a value that may be number
      Returns:
      a long integer value
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not long integer.
      See Also:
    • getLongEx

      public static long getLongEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets a long integer. (Permit exception)

      When the entity of the object is expected as number, it can be converted into long integer with this method.
      However, if the evaluated result is not long integer, the exception is thrown.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be number
      config - configuration if it is needed, null otherwise
      Returns:
      a long integer value
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not long integer.
      See Also:
    • getLongs

      public static long @Nullable [] getLongs(@Nullable Object... objects)
      Gets an array of long integer.

      When the entity of the object is expected as an array of number, it can be converted with this method.
      However, if there is invalid element, such as boolean, null is returned.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         ArrayList<Object> array = new ArrayList<>();
         array.add(1);
         array.add(3);
         array.add(5);
         // Example
         long[] longs = Viv.getLongs(array);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Result result = Viv.run("return([7, 9])");
         // Example
         long[] longs = Viv.getLongs(result);
       

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String or value is not number, this method returns null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      
         long[] longs = Viv.getLongs("return([7, 9])");
       
      Parameters:
      objects - a value that may be an array or a block
      Returns:
      an array of long integer null if evaluation is failed or the evaluated result is not an array of long integer.
      See Also:
    • getLongs

      public static long @Nullable [] getLongs(@Nullable Object[] objects, @Nullable Config config)
      Gets an array of long integer.

      When the entity of the object is expected as an array of number, it can be converted with this method.
      However, if there is invalid element, such as boolean, null is returned.

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String or value is not number, this method returns null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be an array or a block
      config - configuration if it is needed, null otherwise
      Returns:
      an array of long integer. null if evaluation is failed or the evaluated result is not an array of long integer.
      See Also:
    • getLongsEx

      public static long[] getLongsEx(@Nullable Object... objects) throws VivException
      Gets an array of long integer. (Permit exception)

      When the entity of the object is expected as an array of number, it can be converted with this method.
      However, if there is invalid element, such as boolean, the exception is thrown.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         ArrayList<Object> array = new ArrayList<>();
         array.add(1);
         array.add(3);
         array.add(5);
         // Example
         long[] longs = Viv.getLongsEx(array);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Object object = Viv.runEx("return([7, 9])");
         // Example
         long[] longs = Viv.getLongsEx(object);
       

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String or value is not number, this method throws the exception.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      
         long[] longs = Viv.getLongsEx("return([7, 9])");
       
      Parameters:
      objects - a value that may be an array or a block
      Returns:
      an array of long integer
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not an array of long integer.
      See Also:
    • getLongsEx

      public static long[] getLongsEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets an array of long integer. (Permit exception)

      When the entity of the object is expected as an array of number, it can be converted with this method.
      However, if there is invalid element, such as boolean, the exception is thrown.

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String or value is not number, this method throws the exception.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be an array or a block
      config - configuration if it is needed, null otherwise
      Returns:
      an array of long integer
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not an array of long integer.
      See Also:
    • getLongOrNulls

      public static @Nullable Long @Nullable [] getLongOrNulls(@Nullable Object... objects)
      Gets an array of long integer.

      When the entity of the object is expected as an array of number, it can be converted with this method.
      Even if there is invalid element, such as boolean, it will be replaced with null.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         ArrayList<Object> array = new ArrayList<>();
         array.add(1);
         array.add(false);  // --> null
         array.add(5);
         // Example
         Long[] longs = Viv.getLongOrNulls(array);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Result result = Viv.run("return([7, false])");
         // Example
         Long[] longs = Viv.getLongOrNulls(result);
       

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String, this method returns null.
      Even if there is invalid value, such as boolean, it will be replaced with null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      
         Long[] longs = Viv.getLongOrNulls("return([7, false])");
       
      Parameters:
      objects - a value that may be an array or a block
      Returns:
      an array of long integer/null. null if evaluation is failed or the evaluated result is not an array of long integer.
      See Also:
    • getLongOrNulls

      public static @Nullable Long @Nullable [] getLongOrNulls(@Nullable Object[] objects, @Nullable Config config)
      Gets an array of long integer.

      When the entity of the object is expected as an array of number, it can be converted with this method.
      Even if there is invalid element, such as boolean, it will be replaced with null.

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String, this method returns null.
      Even if there is invalid value, such as boolean, it will be replaced with null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be an array or a block
      config - configuration if it is needed, null otherwise
      Returns:
      an array of long integer/null. null if evaluation is failed or the evaluated result is not an array of long integer.
      See Also:
    • getLongOrNullsEx

      public static @Nullable Long[] getLongOrNullsEx(@Nullable Object... objects) throws VivException
      Gets an array of long integer. (Permit exception)

      When the entity of the object is expected as an array of number, it can be converted with this method.
      Even if there is invalid element, such as boolean, it will be replaced with null.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         ArrayList<Object> array = new ArrayList<>();
         array.add(1);
         array.add(false);  // --> null
         array.add(5);
         // Example
         Long[] longs = Viv.getLongOrNullsEx(array);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Object object = Viv.runEx("return([7, false])");
         // Example
         Long[] longs = Viv.getLongOrNullsEx(object);
       

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String, this method throws the exception.
      Even if there is invalid value, such as boolean, it will be replaced with null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      
         Long[] longs = Viv.getLongOrNullsEx("return([7, false])");
       
      Parameters:
      objects - a value that may be an array or a block
      Returns:
      an array of long integer/null
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not an array of long integer.
      See Also:
    • getLongOrNullsEx

      public static @Nullable Long[] getLongOrNullsEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets an array of long integer. (Permit exception)

      When the entity of the object is expected as an array of number, it can be converted with this method.
      Even if there is invalid element, such as boolean, it will be replaced with null.

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String, this method throws the exception.
      Even if there is invalid value, such as boolean, it will be replaced with null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be an array or a block
      config - configuration if it is needed, null otherwise
      Returns:
      an array of long integer/null
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not an array of long integer.
      See Also:
    • getFloat

      public static @Nullable Float getFloat(@Nullable Object... objects)
      Gets a floating-point number.

      When the entity of the object is expected as number, it can be converted into floating-point number with this method.
      However, if the evaluated result is not floating-point number, null is returned.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         Object obj = 1.0;
         // Example
         Float value = Viv.getFloat(obj);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Result result = Viv.run("return(1.0)");
         // Example
         Float value = Viv.getFloat(result);
       

      The same arguments of Viv.run and Viv.runEx can be given.

      
         Float value = Viv.getFloat("return(1.0)");
       
      Parameters:
      objects - a value that may be number
      Returns:
      a floating-point number value. null if evaluation is failed or the evaluated result is not an array of floating-point number.
      See Also:
    • getFloat

      public static @Nullable Float getFloat(@Nullable Object[] objects, @Nullable Config config)
      Gets a floating-point number.

      When the entity of the object is expected as number, it can be converted into floating-point number with this method.
      However, if the evaluated result is not floating-point number, null is returned.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be number
      config - configuration if it is needed, null otherwise
      Returns:
      a floating-point number value. null if evaluation is failed or the evaluated result is not an array of floating-point number.
      See Also:
    • getFloatEx

      public static float getFloatEx(@Nullable Object... objects) throws VivException
      Gets a floating-point number. (Permit exception)

      When the entity of the object is expected as number, it can be converted into floating-point number with this method.
      However, if the evaluated result is not floating-point number, null is returned.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         Object obj = 1.0;
         // Example
         float value = Viv.getFloatEx(obj);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Object object = Viv.runEx("return(1.0)");
         // Example
         float value = Viv.getFloatEx(object);
       

      The same arguments of Viv.run and Viv.runEx can be given.

      
         float value = Viv.getFloatEx("return(1.0)");
       
      Parameters:
      objects - a value that may be number
      Returns:
      a floating-point number value
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not floating-point number.
      See Also:
    • getFloatEx

      public static float getFloatEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets a floating-point number. (Permit exception)

      When the entity of the object is expected as number, it can be converted into floating-point number with this method.
      However, if the evaluated result is not floating-point number, null is returned.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be number
      config - configuration if it is needed, null otherwise
      Returns:
      a floating-point number value
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not floating-point number.
      See Also:
    • getFloats

      public static float @Nullable [] getFloats(@Nullable Object... objects)
      Gets an array of floating-point number.

      When the entity of the object is expected as an array of number, it can be converted with this method.
      However, if there is invalid element, such as boolean, null is returned.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         ArrayList<Object> array = new ArrayList<>();
         array.add(1.0);
         array.add(3.0);
         array.add(5.0);
         // Example
         float[] floats = Viv.getFloats(array);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Result result = Viv.run("return([7.0, 9.0])");
         // Example
         float[] floats = Viv.getFloats(result);
       

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String or value is not number, this method returns null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      
         float[] floats = Viv.getFloats("return([7.0, 9.0])");
       
      Parameters:
      objects - a value that may be an array or a block
      Returns:
      an array of floating-point number. null if evaluation is failed or the evaluated result is not an array of floating-point number.
      See Also:
    • getFloats

      public static float @Nullable [] getFloats(@Nullable Object[] objects, @Nullable Config config)
      Gets an array of floating-point number.

      When the entity of the object is expected as an array of number, it can be converted with this method.
      However, if there is invalid element, such as boolean, null is returned.

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String or value is not number, this method returns null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be an array or a block
      config - configuration if it is needed, null otherwise
      Returns:
      an array of floating-point number. null if evaluation is failed or the evaluated result is not an array of floating-point number.
      See Also:
    • getFloatsEx

      public static float[] getFloatsEx(@Nullable Object... objects) throws VivException
      Gets an array of floating-point number. (Permit exception)

      When the entity of the object is expected as an array of number, it can be converted with this method.
      However, if there is invalid element, such as boolean, the exception is thrown.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         ArrayList<Object> array = new ArrayList<>();
         array.add(1.0);
         array.add(3.0);
         array.add(5.0);
         // Example
         float[] floats = Viv.getFloatsEx(array);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Object object = Viv.runEx("return([7.0, 9.0])");
         // Example
         float[] floats = Viv.getFloatsEx(object);
       

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String or value is not number, this method throws the exception.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      
         float[] floats = Viv.getFloatsEx("return([7.0, 9.0])");
       
      Parameters:
      objects - a value that may be an array or a block
      Returns:
      an array of floating-point number
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not an array of floating-point number.
      See Also:
    • getFloatsEx

      public static float[] getFloatsEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets an array of floating-point number. (Permit exception)

      When the entity of the object is expected as an array of number, it can be converted with this method.
      However, if there is invalid element, such as boolean, the exception is thrown.

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String or value is not number, this method throws the exception.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be an array or a block
      config - configuration if it is needed, null otherwise
      Returns:
      an array of floating-point number
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not an array of floating-point number.
      See Also:
    • getFloatOrNulls

      public static @Nullable Float @Nullable [] getFloatOrNulls(@Nullable Object... objects)
      Gets an array of floating-point number.

      When the entity of the object is expected as an array of number, it can be converted with this method.
      Even if there is invalid element, such as boolean, it will be replaced with null.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         ArrayList<Object> array = new ArrayList<>();
         array.add(1.0);
         array.add(false);  // --> null
         array.add(5.0);
         // Example
         Float[] floats = Viv.getFloatOrNulls(array);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Result result = Viv.run("return([7.0, false])");
         // Example
         Float[] floats = Viv.getFloatOrNulls(result);
       

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String, this method returns null.
      Even if there is invalid value, such as boolean, it will be replaced with null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      
         Float[] floats = Viv.getFloatOrNulls("return([7.0, false])");
       
      Parameters:
      objects - a value that may be an array or a block
      Returns:
      an array of floating-point number/null. null if evaluation is failed or the evaluated result is not an array of floating-point number.
      See Also:
    • getFloatOrNulls

      public static @Nullable Float @Nullable [] getFloatOrNulls(@Nullable Object[] objects, @Nullable Config config)
      Gets an array of floating-point number.

      When the entity of the object is expected as an array of number, it can be converted with this method.
      Even if there is invalid element, such as boolean, it will be replaced with null.

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String, this method returns null.
      Even if there is invalid value, such as boolean, it will be replaced with null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be an array or a block
      config - configuration if it is needed, null otherwise
      Returns:
      an array of floating-point number/null. null if evaluation is failed or the evaluated result is not an array of floating-point number.
      See Also:
    • getFloatOrNullsEx

      public static @Nullable Float[] getFloatOrNullsEx(@Nullable Object... objects) throws VivException
      Gets an array of floating-point number. (Permit exception)

      When the entity of the object is expected as an array of number, it can be converted with this method.
      Even if there is invalid element, such as boolean, it will be replaced with null.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         ArrayList<Object> array = new ArrayList<>();
         array.add(1.0);
         array.add(3.0);
         array.add(5.0);
         // Example
         Float[] floats = Viv.getFloatOrNullsEx(array);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Object object = Viv.runEx("return([7.0, 9.0])");
         // Example
         Float[] floats = Viv.getFloatOrNullsEx(object);
       

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String, this method throws the exception.
      Even if there is invalid value, such as boolean, it will be replaced with null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      
         Float[] floats = Viv.getFloatOrNullsEx("return([7.0, 9.0])");
       
      Parameters:
      objects - a value that may be an array or a block
      Returns:
      an array of floating-point number/null
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not an array of floating-point number.
      See Also:
    • getFloatOrNullsEx

      public static @Nullable Float[] getFloatOrNullsEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets an array of floating-point number. (Permit exception)

      When the entity of the object is expected as an array of number, it can be converted with this method.
      Even if there is invalid element, such as boolean, it will be replaced with null.

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String, this method throws the exception.
      Even if there is invalid value, such as boolean, it will be replaced with null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be an array or a block
      config - configuration if it is needed, null otherwise
      Returns:
      an array of floating-point number/null
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not an array of floating-point number.
      See Also:
    • getDouble

      public static @Nullable Double getDouble(@Nullable Object... objects)
      Gets a double-precision floating-point number.

      When the entity of the object is expected as number, it can be converted into double-precision floating-point number with this method.
      However, if the evaluated result is not double-precision floating-point number, null is returned.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         Object obj = 1.0;
         // Example
         Double value = Viv.getDouble(obj);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Result result = Viv.run("return(1.0)");
         // Example
         Double value = Viv.getDouble(result);
       

      The same arguments of Viv.run and Viv.runEx can be given.

      
         double value = Viv.getDouble("return(1.0)");
       
      Parameters:
      objects - a value that may be number
      Returns:
      a double-precision floating-point number value. null if evaluation is failed or the evaluated result is not an array of double-precision floating-point number.
      See Also:
    • getDouble

      public static @Nullable Double getDouble(@Nullable Object[] objects, @Nullable Config config)
      Gets a double-precision floating-point number.

      When the entity of the object is expected as number, it can be converted into double-precision floating-point number with this method.
      However, if the evaluated result is not double-precision floating-point number, null is returned.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be number
      config - configuration if it is needed, null otherwise
      Returns:
      a double-precision floating-point number value. null if evaluation is failed or the evaluated result is not an array of double-precision floating-point number.
      See Also:
    • getDoubleEx

      public static double getDoubleEx(@Nullable Object... objects) throws VivException
      Gets a double-precision floating-point number. (Permit exception)

      When the entity of the object is expected as number, it can be converted into double-precision floating-point number with this method.
      However, if the evaluated result is not double-precision floating-point number, the exception is thrown.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         Object obj = 1.0;
         // Example
         double value = Viv.getDoubleEx(obj);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Object object = Viv.runEx("return(1.0)");
         // Example
         double value = Viv.getDoubleEx(object);
       

      The same arguments of Viv.run and Viv.runEx can be given.

      
         double value = Viv.getDoubleEx("return(1.0)");
       
      Parameters:
      objects - a value that may be number
      Returns:
      a double-precision floating-point number value
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not double-precision floating-point number.
      See Also:
    • getDoubleEx

      public static double getDoubleEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets a double-precision floating-point number. (Permit exception)

      When the entity of the object is expected as number, it can be converted into double-precision floating-point number with this method.
      However, if the evaluated result is not double-precision floating-point number, the exception is thrown.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be number
      config - configuration if it is needed, null otherwise
      Returns:
      a double-precision floating-point number value
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not double-precision floating-point number.
      See Also:
    • getDoubles

      public static double @Nullable [] getDoubles(@Nullable Object... objects)
      Gets an array of double-precision floating-point number.

      When the entity of the object is expected as an array of number, it can be converted with this method.
      However, if there is invalid element, such as boolean, null is returned.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         ArrayList<Object> array = new ArrayList<>();
         array.add(1.0);
         array.add(3.0);
         array.add(5.0);
         // Example
         double[] doubles = Viv.getDoubles(array);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Result result = Viv.run("return([7.0, 9.0])");
         // Example
         double[] doubles = Viv.getDoubles(result);
       

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String or value is not number, this method returns null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      
         double[] doubles = Viv.getDoubles("return([7.0, 9.0])");
       
      Parameters:
      objects - a value that may be an array or a block
      Returns:
      an array of double-precision floating-point number. null if evaluation is failed or the evaluated result is not an array of double-precision floating-point number.
      See Also:
    • getDoubles

      public static double @Nullable [] getDoubles(@Nullable Object[] objects, @Nullable Config config)
      Gets an array of double-precision floating-point number.

      When the entity of the object is expected as an array of number, it can be converted with this method.
      However, if there is invalid element, such as boolean, null is returned.

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String or value is not number, this method returns null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be an array or a block
      config - configuration if it is needed, null otherwise
      Returns:
      an array of double-precision floating-point number. null if evaluation is failed or the evaluated result is not an array of double-precision floating-point number.
      See Also:
    • getDoublesEx

      public static double[] getDoublesEx(@Nullable Object... objects) throws VivException
      Gets an array of double-precision floating-point number. (Permit exception)

      When the entity of the object is expected as an array of number, it can be converted with this method.
      However, if there is invalid element, such as boolean, the exception is thrown.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         ArrayList<Object> array = new ArrayList<>();
         array.add(1.0);
         array.add(3.0);
         array.add(5.0);
         // Example
         double[] doubles = Viv.getDoublesEx(array);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Object object = Viv.runEx("return([7.0, 9.0])");
         // Example
         double[] doubles = Viv.getDoublesEx(object);
       

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String or value is not number, this method throws the exception.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      
         double[] doubles = Viv.getDoublesEx("return([7.0, 9.0])");
       
      Parameters:
      objects - a value that may be an array or a block
      Returns:
      an array of double-precision floating-point number
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not an array of double-precision floating-point number.
      See Also:
    • getDoublesEx

      public static double[] getDoublesEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets an array of double-precision floating-point number. (Permit exception)

      When the entity of the object is expected as an array of number, it can be converted with this method.
      However, if there is invalid element, such as boolean, the exception is thrown.

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String or value is not number, this method throws the exception.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be an array or a block
      config - configuration if it is needed, null otherwise
      Returns:
      an array of double-precision floating-point number
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not an array of double-precision floating-point number.
      See Also:
    • getDoubleOrNulls

      public static @Nullable Double @Nullable [] getDoubleOrNulls(@Nullable Object... objects)
      Gets an array of double-precision floating-point number.

      When the entity of the object is expected as an array of number, it can be converted with this method.
      Even if there is invalid element, such as boolean, it will be replaced with null.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         ArrayList<Object> array = new ArrayList<>();
         array.add(1.0);
         array.add(false);  // --> null
         array.add(5.0);
         // Example
         Double[] doubles = Viv.getDoubleOrNulls(array);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Result result = Viv.run("return([7.0, false])");
         // Example
         Double[] doubles = Viv.getDoubleOrNulls(result);
       

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String, this method returns null.
      Even if there is invalid value, such as boolean, it will be replaced with null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      
         Double[] doubles = Viv.getDoubleOrNulls("return([7.0, false])");
       
      Parameters:
      objects - a value that may be an array or a block
      Returns:
      an array of double-precision floating-point number/null. null if evaluation is failed or the evaluated result is not an array of double-precision floating-point number.
      See Also:
    • getDoubleOrNulls

      public static @Nullable Double @Nullable [] getDoubleOrNulls(@Nullable Object[] objects, @Nullable Config config)
      Gets an array of double-precision floating-point number.

      When the entity of the object is expected as an array of number, it can be converted with this method.
      Even if there is invalid element, such as boolean, it will be replaced with null.

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String, this method returns null.
      Even if there is invalid value, such as boolean, it will be replaced with null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be an array or a block
      config - configuration if it is needed, null otherwise
      Returns:
      an array of double-precision floating-point number/null. null if evaluation is failed or the evaluated result is not an array of double-precision floating-point number.
      See Also:
    • getDoubleOrNullsEx

      public static @Nullable Double[] getDoubleOrNullsEx(@Nullable Object... objects) throws VivException
      Gets an array of double-precision floating-point number. (Permit exception)

      When the entity of the object is expected as an array of number, it can be converted with this method.
      Even if there is invalid element, such as boolean, it will be replaced with null.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         ArrayList<Object> array = new ArrayList<>();
         array.add(1.0);
         array.add(false);  // --> null
         array.add(5.0);
         // Example
         Double[] doubles = Viv.getDoubleOrNullsEx(array);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Object object = Viv.runEx("return([7.0, false])");
         // Example
         Double[] doubles = Viv.getDoubleOrNullsEx(object);
       

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String, this method throws the exception.
      Even if there is invalid value, such as boolean, it will be replaced with null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      
         Double[] doubles = Viv.getDoubleOrNullsEx("return([7.0, false])");
       
      Parameters:
      objects - a value that may be an array or a block
      Returns:
      an array of double-precision floating-point number/null
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not an array of double-precision floating-point number.
      See Also:
    • getDoubleOrNullsEx

      public static @Nullable Double[] getDoubleOrNullsEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets an array of double-precision floating-point number. (Permit exception)

      When the entity of the object is expected as an array of number, it can be converted with this method.
      Even if there is invalid element, such as boolean, it will be replaced with null.

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String, this method throws the exception.
      Even if there is invalid value, such as boolean, it will be replaced with null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be an array or a block
      config - configuration if it is needed, null otherwise
      Returns:
      an array of double-precision floating-point number/null
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not an array of double-precision floating-point number.
      See Also:
    • getString

      public static @Nullable String getString(@Nullable Object... objects)
      Gets a string.

      When the entity of the object is expected as string, it can be converted with this method.
      However, if the evaluated result is not string, null is returned.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         Object obj = "test";
         // Example
         String value = Viv.getString(obj);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Result result = Viv.run("a='test'", "return(a)");
         // Example
         String value = Viv.getString(result);
       

      The same arguments of Viv.run and Viv.runEx can be given.

      
         String value = Viv.getString("a='test'", "return(a)");
       
      On the other hand, the following sample may be looked like strange. But the single string is passed through simply.
      
         String value1 = Viv.getString("return('test')");  // "return('test')"
         String value2 = Viv.getString("a='test'", "return(a)");  // "a='test'", "return(a)"
       
      Parameters:
      objects - object that may be a string value
      Returns:
      a string value. null if evaluation is failed or the evaluated result is not string.
      See Also:
    • getString

      public static @Nullable String getString(@Nullable Object[] objects, @Nullable Config config)
      Gets a string.

      When the entity of the object is expected as string, it can be converted with this method.
      However, if the evaluated result is not string, null is returned.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - object that may be a string value
      config - configuration if it is needed, null otherwise
      Returns:
      a string value. null if evaluation is failed or the evaluated result is not string.
      See Also:
    • getStringEx

      public static String getStringEx(@Nullable Object... objects) throws VivException
      Gets a string. (Permit exception)

      When the entity of the object is expected as string, it can be converted with this method.
      However, if the evaluated result is not string, the exception is thrown.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         Object obj = "test";
         // Example
         String value = Viv.getStringEx(obj);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Object object = Viv.runEx("a='test'", "return(a)");
         // Example
         String value = Viv.getStringEx(object);  // "test"
       

      The same arguments of Viv.run and Viv.runEx can be given.

      
         String value = Viv.getStringEx("a='test'", "return(a)");  // "test"
       
      On the other hand, the following sample may be looked like strange. But the single string is passed through simply.
      
         String value1 = Viv.getStringEx("return('test')");  // "return('test')"
         String value2 = Viv.getStringEx("a='test'", "return(a)");  // "a='test'", "return(a)"
       
      Parameters:
      objects - object that may be a string value
      Returns:
      a string value
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not string.
      See Also:
    • getStringEx

      public static String getStringEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets a string. (Permit exception)

      When the entity of the object is expected as string, it can be converted with this method.
      However, if the evaluated result is not string, the exception is thrown.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - object that may be a string value
      config - configuration if it is needed, null otherwise
      Returns:
      a string value
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not string.
      See Also:
    • getStrings

      public static String @Nullable [] getStrings(@Nullable Object... objects)
      Gets an array of string.

      When the entity of the object is expected as an array of string, it can be converted with this method.
      However, if there is invalid element, such as integer, null is returned.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         ArrayList<Object> array = new ArrayList<>();
         array.add("alpha");
         array.add("beta");
         array.add("gamma");
         // Example
         String[] strings = Viv.getStrings(array);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Result result = Viv.run("return(['alpha', 'beta'])");
         // Example
         String[] strings = Viv.getStrings(result);
       

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key or value is not String, this method returns null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      
         String[] strings =
             Viv.getStrings("{\"a\": \"alpha\", \"b\": \"beta\"}");
       
      Parameters:
      objects - a value that may be an array or a block
      Returns:
      an array of string. null if evaluation is failed or the evaluated result is not an array of string.
      See Also:
    • getStrings

      public static String @Nullable [] getStrings(@Nullable Object[] objects, @Nullable Config config)
      Gets an array of string.

      When the entity of the object is expected as an array of string, it can be converted with this method.
      However, if there is invalid element, such as integer, null is returned.

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key or value is not String, this method returns null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be an array or a block
      config - configuration if it is needed, null otherwise
      Returns:
      an array of string. null if evaluation is failed or the evaluated result is not an array of string.
      See Also:
    • getStringsEx

      public static String[] getStringsEx(@Nullable Object... objects) throws VivException
      Gets an array of string. (Permit exception)

      When the entity of the object is expected as an array of string, it can be converted with this method.
      However, if there is invalid element, such as integer, the exception is thrown.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         ArrayList<Object> array = new ArrayList<>();
         array.add("alpha");
         array.add("beta");
         array.add("gamma");
         // Example
         String[] strings = Viv.getStringsEx(array);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Object object = Viv.runEx("return(['alpha', 'beta'])");
         // Example
         String[] strings = Viv.getStringsEx(object);
       

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key or value is not String, this method throws the exception.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      
         String[] strings =
             Viv.getStringsEx("{\"a\": \"alpha\", \"b\": \"beta\"}");
       
      Parameters:
      objects - a value that may be an array or a block
      Returns:
      an array of string
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not an array of string.
      See Also:
    • getStringsEx

      public static String[] getStringsEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets an array of String. (Permit exception)

      When the entity of the object is expected as an array of string, it can be converted with this method.
      However, if there is invalid element, such as integer, the exception is thrown.

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key or value is not String, this method throws the exception.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be an array or a block
      config - configuration if it is needed, null otherwise
      Returns:
      an array of string
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not an array of string.
      See Also:
    • getStringOrNulls

      public static @Nullable String @Nullable [] getStringOrNulls(@Nullable Object... objects)
      Gets an array of string.

      When the entity of the object is expected as an array of string, it can be converted with this method.
      Even if there is invalid element, such as boolean, it will be replaced with null.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         ArrayList<Object> array = new ArrayList<>();
         array.add("alpha");
         array.add(false);  // --> null
         array.add("gamma");
         // Example
         String[] strings = Viv.getStringOrNulls(array);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Result result = Viv.run("return(['alpha', false])");
         // Example
         String[] strings = Viv.getStringOrNulls(result);
       

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String, this method returns null.
      Even if there is invalid value, such as boolean, it will be replaced with null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      
         String[] strings =
             Viv.getStringOrNulls("{\"a\": \"alpha\", \"b\": false}");
       
      Parameters:
      objects - a value that may be an array or a block
      Returns:
      an array of string/null. null if evaluation is failed or the evaluated result is not an array of string.
      See Also:
    • getStringOrNulls

      public static @Nullable String @Nullable [] getStringOrNulls(@Nullable Object[] objects, @Nullable Config config)
      Gets an array of string.

      When the entity of the object is expected as an array of string, it can be converted with this method.
      Even if there is invalid element, such as boolean, it will be replaced with null.

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String, this method returns null.
      Even if there is invalid value, such as boolean, it will be replaced with null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be an array or a block
      config - configuration if it is needed, null otherwise
      Returns:
      an array of string/null. null if evaluation is failed or the evaluated result is not an array of string.
      See Also:
    • getStringOrNullsEx

      public static @Nullable String[] getStringOrNullsEx(@Nullable Object... objects) throws VivException
      Gets an array of string. (Permit exception)

      When the entity of the object is expected as an array of string, it can be converted with this method.
      Even if there is invalid element, such as boolean, it will be replaced with null.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         ArrayList<Object> array = new ArrayList<>();
         array.add("alpha");
         array.add(false);  // --> null
         array.add("gamma");
         // Example
         String[] strings = Viv.getStringOrNullsEx(array);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Object object = Viv.runEx("return(['alpha', false])");
         // Example
         String[] strings = Viv.getStringOrNullsEx(object);
       

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String, this method throws the exception.
      Even if there is invalid value, such as boolean, it will be replaced with null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      
         String[] strings =
             Viv.getStringOrNullsEx("{\"a\": \"alpha\", \"b\": false}");
       
      Parameters:
      objects - a value that may be an array or a block
      Returns:
      an array of string/null
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not an array of string.
      See Also:
    • getStringOrNullsEx

      public static @Nullable String[] getStringOrNullsEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets an array of String. (Permit exception)

      When the entity of the object is expected as an array of string, it can be converted with this method.
      Even if there is invalid element, such as boolean, it will be replaced with null.

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String, this method throws the exception.
      Even if there is invalid value, such as boolean, it will be replaced with null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be an array or a block
      config - configuration if it is needed, null otherwise
      Returns:
      an array of string/null
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not an array of string.
      See Also:
    • getObjects

      public static Object @Nullable [] getObjects(@Nullable Object... objects)
      Gets an array of object.

      When the entity of the object is expected as an array of Object, it can be converted with this method.
      However, if there is null, null is returned as the whole returned value.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         ArrayList<Object> array = new ArrayList<>();
         array.add("alpha");
         array.add(true);
         array.add(100);
         // Example
         Object[] objects = Viv.getObjects(array);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Result result = Viv.run("return(['alpha', true])");
         // Example
         Object[] objects = Viv.getObjects(result);
       

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String or value is not Object, this method returns null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      
         Object[] objects =
             Viv.getObjects("{\"a\": \"alpha\", \"b\": true}");
       
      Parameters:
      objects - a value that may be an array or a block
      Returns:
      an array of Object. null if evaluation is failed or the evaluated result is not an array of Object.
      See Also:
    • getObjects

      public static Object @Nullable [] getObjects(@Nullable Object[] objects, @Nullable Config config)
      Gets an array of object.

      When the entity of the object is expected as an array of Object, it can be converted with this method.
      However, if there is null, null is returned as the whole returned value.

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String or value is not Object, this method returns null.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be an array or a block
      config - configuration if it is needed, null otherwise
      Returns:
      an array of Object. null if evaluation is failed or the evaluated result is not an array of Object.
      See Also:
    • getObjectsEx

      public static Object[] getObjectsEx(@Nullable Object... objects) throws VivException
      Gets an array of object. (Permit exception)

      When the entity of the object is expected as an array of Object, it can be converted with this method.
      However, if there is null, the exception is thrown.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         ArrayList<Object> array = new ArrayList<>();
         array.add("alpha");
         array.add(true);
         array.add(100);
         // Example
         Object[] objects = Viv.getObjectsEx(array);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Object object = Viv.runEx("return(['alpha', true])");
         // Example
         Object[] objects = Viv.getObjectsEx(object);
       

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String or value is not Object, this method throws the exception.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      
         Object[] objects =
             Viv.getObjectsEx("{\"a\": \"alpha\", \"b\": true}");
       
      Parameters:
      objects - a value that may be an array or a block
      Returns:
      an array of Object
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not an array of Object.
      See Also:
    • getObjectsEx

      public static Object[] getObjectsEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets an array of object. (Permit exception)

      When the entity of the object is expected as an array of Object, it can be converted with this method.
      However, if there is null, the exception is thrown.

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String or value is not Object, this method throws the exception.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be an array or a block
      config - configuration if it is needed, null otherwise
      Returns:
      an array of Object
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not an array of Object.
      See Also:
    • getObjectOrNulls

      public static @Nullable Object @Nullable [] getObjectOrNulls(@Nullable Object... objects)
      Gets an array of object.

      When the entity of the object is expected as an array of Object, it can be converted with this method.
      Even if there is null, it is permitted.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         ArrayList<Object> array = new ArrayList<>();
         array.add("alpha");
         array.add(null);  // --> null
         array.add(100);
         // Example
         Object[] objects = Viv.getObjectOrNulls(array);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Result result = Viv.run("return(['alpha', null])");
         // Example
         Object[] objects = Viv.getObjectOrNulls(result);
       

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String, this method returns null as the whole returned value.
      Even if there is null as value, it is permitted.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      
         Object[] objects =
             Viv.getObjectOrNulls("{\"a\": \"alpha\", \"b\": null}");
       
      Parameters:
      objects - a value that may be an array or a block
      Returns:
      an array of Object/null. null if evaluation is failed or the evaluated result is not an array of Object.
      See Also:
    • getObjectOrNulls

      public static @Nullable Object @Nullable [] getObjectOrNulls(@Nullable Object[] objects, @Nullable Config config)
      Gets an array of object.

      When the entity of the object is expected as an array of Object, it can be converted with this method.
      Even if there is null, it is permitted.

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String, this method returns null as the whole returned value.
      Even if there is null as value, it is permitted.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be an array or a block
      config - configuration if it is needed, null otherwise
      Returns:
      an array of Object/null. null if evaluation is failed or the evaluated result is not an array of Object.
      See Also:
    • getObjectOrNullsEx

      public static @Nullable Object[] getObjectOrNullsEx(@Nullable Object... objects) throws VivException
      Gets an array of object. (Permit exception)

      When the entity of the object is expected as an array of Object, it can be converted with this method.
      Even if there is null, it is permitted.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         ArrayList<Object> array = new ArrayList<>();
         array.add("alpha");
         array.add(null);  // --> null
         array.add(100);
         // Example
         Object[] objects = Viv.getObjectOrNullsEx(array);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Object object = Viv.runEx("return(['alpha', null])");
         // Example
         Object[] objects = Viv.getObjectOrNullsEx(object);
       

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String, this method throws the exception.
      Even if there is null as value, it is permitted.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      
         Object[] objects =
             Viv.getObjectOrNullsEx("{\"a\": \"alpha\", \"b\": null}");
       
      Parameters:
      objects - a value that may be an array or a block
      Returns:
      an array of Object/null
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not an array of Object.
      See Also:
    • getObjectOrNullsEx

      public static @Nullable Object[] getObjectOrNullsEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets an array of object. (Permit exception)

      When the entity of the object is expected as an array of Object, it can be converted with this method.
      Even if there is null, it is permitted.

      When key-value pairs (a.k.a. block, object, map, dict, hashes, or associative arrays) is given, its values are treated. In other words, keys are ignored. However, if key is not String, this method throws the exception.
      Even if there is null as value, it is permitted.
      The order of values is unknown. The appended order into key-value pairs is ignored.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - a value that may be an array or a block
      config - configuration if it is needed, null otherwise
      Returns:
      an array of Object/null
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not an array of Object.
      See Also:
    • getArrayList

      public static @Nullable ArrayList<@Nullable Object> getArrayList(@Nullable Object... objects)
      Gets an ArrayList<@Nullable Object>.

      When the entity of the object is expected as ArrayList<@Nullable Object>, it can be converted with this method.
      However, if the evaluated result is not ArrayList<@Nullable Object>, null is returned.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         ArrayList<Integer> array = new ArrayList<>();
         array.add(10);
         array.add(20);
         Object obj = array;
         // Example
         ArrayList<@Nullable Object> value = Viv.getArrayList(obj);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Result result = Viv.run("a=[]", "a+=10", "a+=20", "return(a)");
         // Example
         ArrayList<@Nullable Object> value = Viv.getArrayList(result);
         Object element1 = value.get(0);  // 10
         Object element2 = value.get(1);  // 20
       

      The same arguments of Viv.run and Viv.runEx can be given.

      
         ArrayList<@Nullable Object> value =
             Viv.getArrayList("a=[]", "a+=10", "a+=20", "return(a)");
       
      Parameters:
      objects - object that may be a ArrayList<@Nullable Object> value
      Returns:
      an ArrayList<@Nullable Object> value. null if evaluation is failed or the evaluated result is not ArrayList<@Nullable Object>.
      See Also:
    • getArrayList

      public static @Nullable ArrayList<@Nullable Object> getArrayList(@Nullable Object[] objects, @Nullable Config config)
      Gets an ArrayList<@Nullable Object>.

      When the entity of the object is expected as ArrayList<@Nullable Object>, it can be converted with this method.
      However, if the evaluated result is not ArrayList<@Nullable Object>, null is returned.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - object that may be a ArrayList<@Nullable Object> value
      config - configuration if it is needed, null otherwise
      Returns:
      an ArrayList<@Nullable Object> value. null if evaluation is failed or the evaluated result is not ArrayList<@Nullable Object>.
      See Also:
    • getArrayListEx

      public static ArrayList<@Nullable Object> getArrayListEx(@Nullable Object... objects) throws VivException
      Gets an ArrayList<@Nullable Object>. (Permit exception)

      When the entity of the object is expected as ArrayList<@Nullable Object>, it can be converted with this method.
      However, if the evaluated result is not ArrayList<@Nullable Object>, the exception is thrown.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         ArrayList<Integer> array = new ArrayList<>();
         array.add(10);
         array.add(20);
         Object obj = array;
         // Example
         ArrayList<@Nullable Object> value = Viv.getArrayListEx(obj);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Object object = Viv.runEx("a=[]", "a+=10", "a+=20", "return(a)");
         // Example
         ArrayList<@Nullable Object> value = Viv.getArrayListEx(object);
         Object element1 = value.get(0);  // 10
         Object element2 = value.get(1);  // 20
       

      The same arguments of Viv.run and Viv.runEx can be given.

      
         ArrayList<@Nullable Object> value =
             Viv.getArrayListEx("a=[]", "a+=10", "a+=20", "return(a)");
       
      Parameters:
      objects - object that may be a ArrayList<@Nullable Object> value
      Returns:
      an ArrayList<@Nullable Object> value
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not ArrayList<@Nullable Object>.
      See Also:
    • getArrayListEx

      public static ArrayList<@Nullable Object> getArrayListEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets an ArrayList<@Nullable Object>. (Permit exception)

      When the entity of the object is expected as ArrayList<@Nullable Object>, it can be converted with this method.
      However, if the evaluated result is not ArrayList<@Nullable Object>, the exception is thrown.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - object that may be a ArrayList<@Nullable Object> value
      config - configuration if it is needed, null otherwise
      Returns:
      an ArrayList<@Nullable Object> value
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not ArrayList<@Nullable Object>.
      See Also:
    • getHashMap

      public static @Nullable HashMap<String,@Nullable Object> getHashMap(@Nullable Object... objects)
      Gets a HashMap<String, @Nullable Object>.

      When the entity of the object is expected as HashMap<String, @Nullable Object>, it can be converted with this method.
      However, if the evaluated result is not HashMap<String, @Nullable Object>, null is returned.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         HashMap<String, Integer> map = new HashMap<>();
         map.put("a", 70);
         map.put("b", 30);
         Object obj = map;
         // Example
         HashMap<String, @Nullable Object> value = Viv.getHashMap(obj);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Result result = Viv.run("{\"a\": 70, \"b\": 30}");
         // Example
         HashMap<String, @Nullable Object> value = Viv.getHashMap(result);
       

      The same arguments of Viv.run and Viv.runEx can be given.

      
         HashMap<String, @Nullable Object> value =
                                  Viv.getHashMap("{\"a\": 70, \"b\": 30}");
       
      Parameters:
      objects - object that may be a HashMap<String, @Nullable Object> value
      Returns:
      a HashMap<String, @Nullable Object> value. null if evaluation is failed or the evaluated result is not HashMap<String, @Nullable Object>.
      See Also:
    • getHashMap

      public static @Nullable HashMap<String,@Nullable Object> getHashMap(@Nullable Object[] objects, @Nullable Config config)
      Gets a HashMap<String, @Nullable Object>.

      When the entity of the object is expected as HashMap<String, @Nullable Object>, it can be converted with this method.
      However, if the evaluated result is not HashMap<String, @Nullable Object>, null is returned.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - object that may be a HashMap<String, @Nullable Object> value
      config - configuration if it is needed, null otherwise
      Returns:
      a HashMap<String, @Nullable Object> value. null if evaluation is failed or the evaluated result is not HashMap<String, @Nullable Object>.
      See Also:
    • getHashMapEx

      public static HashMap<String,@Nullable Object> getHashMapEx(@Nullable Object... objects) throws VivException
      Gets a HashMap<String, @Nullable Object>. (Permit exception)

      When the entity of the object is expected as HashMap<String, @Nullable Object>, it can be converted with this method.
      However, if the evaluated result is not HashMap<String, @Nullable Object>, the exception is thrown.

      In a simply way, one value is given as argument.
      For example,

      
         // Prepare
         HashMap<String, Integer> map = new HashMap<>();
         map.put("a", 70);
         map.put("b", 30);
         Object obj = map;
         // Example
         HashMap<String, @Nullable Object> value = Viv.getHashMapEx(obj);
       
      Mostly, this is used for the returned value of Viv.run or Viv.runEx method.
      
         // Prepare
         Object object = Viv.runEx("{\"a\": 70, \"b\": 30}");
         // Example
         HashMap<String, @Nullable Object> value = Viv.getHashMapEx(object);
       

      The same arguments of Viv.run and Viv.runEx can be given.

      
         HashMap<String, @Nullable Object> value =
                                  Viv.getHashMapEx("{\"a\": 70, \"b\": 30}");
       
      Parameters:
      objects - object that may be a HashMap<String, @Nullable Object> value
      Returns:
      a HashMap<String, @Nullable Object> value
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not HashMap<String, @Nullable Object>.
      See Also:
    • getHashMapEx

      public static HashMap<String,@Nullable Object> getHashMapEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets a HashMap<String, @Nullable Object>. (Permit exception)

      When the entity of the object is expected as HashMap<String, @Nullable Object>, it can be converted with this method.
      However, if the evaluated result is not HashMap<String, @Nullable Object>, the exception is thrown.

      The same arguments of Viv.run and Viv.runEx can be given.

      Parameters:
      objects - object that may be a HashMap<String, @Nullable Object> value
      config - configuration if it is needed, null otherwise
      Returns:
      a HashMap<String, @Nullable Object> value
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not HashMap<String, @Nullable Object>.
      See Also:
    • getKeyValueBooleans

      public static Viv.KeyValue<Boolean> @Nullable [] getKeyValueBooleans(@Nullable Object... objects)
      Gets key-value pairs as an array. All values are expected as Boolean. When other is given, null is returned.

      For example,

      
         // {"a": true, "b": false}
         String code = "\"a\": true, \"b\": false";
      
         // Evaluate directly.
         Viv.KeyValue<Boolean>[] pairs = Viv.getKeyValueBooleans(code);
         for (Viv.KeyValue<Boolean> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: true, b: false
         }
      
         // Evaluate result.
         Result result = Viv.run(code);
         pairs = Viv.getKeyValueBooleans(result);
         for (Viv.KeyValue<Boolean> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: true, b: false
         }
      
         // Whole values are lost even if there is only one foreign object.
         code = "\"a\": true, \"b\": null";  // replace
         pairs = Viv.getKeyValueBooleans(code);
         System.out.println(pairs == null);  // true
      
         code = "\"a\": true, \"b\": 10";  // replace
         pairs = Viv.getKeyValueBooleans(code);
         System.out.println(pairs == null);  // true
       
      getKeyValueBooleanOrNulls(Object...) is suitable if you want not to lost whole values.
      Parameters:
      objects - object that may be a HashMap<String, Boolean> value
      Returns:
      an array of key-value pairs as KeyValue<Boolean>[]. null if evaluation is failed or the evaluated result is not HashMap<String, Boolean>.
    • getKeyValueBooleans

      public static Viv.KeyValue<Boolean> @Nullable [] getKeyValueBooleans(@Nullable Object[] objects, @Nullable Config config)
      Gets key-value pairs as an array. All values are expected as Boolean. When other is given, null is returned.

      For example,

      
         // {"a": true, "b": false}
         String[] codes = {"\"a\": true", "\"b\": false"};
      
         // Evaluate directly.
         Viv.KeyValue<Boolean>[] pairs = Viv.getKeyValueBooleans(codes, null);
         for (Viv.KeyValue<Boolean> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: true, b: false
         }
      
         // Evaluate result.
         Result result = Viv.run(codes, null);
         pairs = Viv.getKeyValueBooleans(result);
         for (Viv.KeyValue<Boolean> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: true, b: false
         }
      
         // Whole values are lost even if there is only one foreign object.
         codes[1] = "\"b\": null";  // replace
         pairs = Viv.getKeyValueBooleans(codes, null);
         System.out.println(pairs == null);  // true
      
         codes[1] = "\"b\": 10";  // replace
         pairs = Viv.getKeyValueBooleans(codes, null);
         System.out.println(pairs == null);  // true
       
      getKeyValueBooleanOrNulls(Object[], Config) is suitable if you want not to lost whole values.
      Parameters:
      objects - object that may be a HashMap<String, Boolean> value
      config - configuration if it is needed, null otherwise
      Returns:
      an array of key-value pairs as KeyValue<Boolean>[]. null if evaluation is failed or the evaluated result is not HashMap<String, Boolean>.
    • getKeyValueBooleansEx

      public static Viv.KeyValue<Boolean>[] getKeyValueBooleansEx(@Nullable Object... objects) throws VivException
      Gets key-value pairs as an array. (Permit exception) All values are expected as Boolean. When other is given, exception is thrown.

      For example,

      
         // {"a": true, "b": false}
         String code = "\"a\": true, \"b\": false";
      
         // Evaluate directly.
         Viv.KeyValue<Boolean>[] pairs = Viv.getKeyValueBooleansEx(code);
         for (Viv.KeyValue<Boolean> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: true, b: false
         }
      
         // Evaluate result.
         Object object = Viv.runEx(code);
         pairs = Viv.getKeyValueBooleansEx(object);
         for (Viv.KeyValue<Boolean> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: true, b: false
         }
      
         // Whole values are lost even if there is only one foreign object.
         code = "\"a\": true, \"b\": null"; // replace
         pairs = Viv.getKeyValueBooleansEx(code);  // Exception is thrown.
      
         code = "\"a\": true, \"b\": 10"; // replace
         pairs = Viv.getKeyValueBooleansEx(code);  // Exception is thrown.
       
      getKeyValueBooleanOrNullsEx(Object...) is suitable if you want not to lost whole values.
      Parameters:
      objects - object that may be a HashMap<String, Boolean> value
      Returns:
      an array of key-value pairs as KeyValue<Boolean>[]
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not HashMap<String, Boolean>.
    • getKeyValueBooleansEx

      public static Viv.KeyValue<Boolean>[] getKeyValueBooleansEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets key-value pairs as an array. (Permit exception) All values are expected as Boolean. When other is given, exception is thrown.

      For example,

      
         // {"a": true, "b": false}
         String[] codes = {"\"a\": true", "\"b\": false"};
      
         // Evaluate directly.
         Viv.KeyValue<Boolean>[] pairs = Viv.getKeyValueBooleansEx(codes, null);
         for (Viv.KeyValue<Boolean> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: true, b: false
         }
      
         // Evaluate result.
         Object object = Viv.runEx(codes, null);
         pairs = Viv.getKeyValueBooleansEx(object);
         for (Viv.KeyValue<Boolean> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: true, b: false
         }
      
         // Whole values are lost even if there is only one foreign object.
         codes[1] = "\"b\": null";  // replace
         pairs = Viv.getKeyValueBooleansEx(codes);  // Exception is thrown.
      
         codes[1] = "\"b\": 10";  // replace
         pairs = Viv.getKeyValueBooleansEx(codes);  // Exception is thrown.
       
      getKeyValueBooleanOrNullsEx(Object[], Config) is suitable if you want not to lost whole values.
      Parameters:
      objects - object that may be a HashMap<String, Boolean> value
      config - configuration if it is needed, null otherwise
      Returns:
      an array of key-value pairs as KeyValue<Boolean>[]
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not HashMap<String, Boolean>.
    • getKeyValueBooleanOrNulls

      public static Viv.KeyValue<@Nullable Boolean> @Nullable [] getKeyValueBooleanOrNulls(@Nullable Object... objects)
      Gets key-value pairs as an array. All values are expected as Boolean. When other is given, it is replaced with null.

      For example,

      
         // {"a": true, "b": null}
         String code = "{\"a\": true, \"b\": null}";
      
         // Evaluate directly.
         Viv.KeyValue<@Nullable Boolean>[] pairs =
                 Viv.getKeyValueBooleanOrNulls(code);
         for (Viv.KeyValue<@Nullable Boolean> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: true, b: null
         }
      
         // Evaluate result.
         Result result = Viv.run(code);
         pairs = Viv.getKeyValueBooleanOrNulls(result);
         for (Viv.KeyValue<@Nullable Boolean> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: true, b: null
         }
      
         // Evaluate another value directly.
         pairs = Viv.getKeyValueBooleanOrNulls("{\"a\": true, \"b\": 10}");
         for (Viv.KeyValue<@Nullable Boolean> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: true, b: null
         }
       
      Parameters:
      objects - object that may be a HashMap<String, @Nullable Boolean> value
      Returns:
      an array of key-value pairs as KeyValue<@Nullable Boolean>[]. null if evaluation is failed or the evaluated result is not HashMap<String, @Nullable Boolean>.
    • getKeyValueBooleanOrNulls

      public static Viv.KeyValue<@Nullable Boolean> @Nullable [] getKeyValueBooleanOrNulls(@Nullable Object[] objects, @Nullable Config config)
      Gets key-value pairs as an array. All values are expected as Boolean. When other is given, it is replaced with null.

      For example,

      
         // {"a": true, "b": null}
         String[] codes = {"\"a\": true", "\"b\": null"};
      
         // Evaluate directly.
         Viv.KeyValue<@Nullable Boolean>[] pairs =
                 Viv.getKeyValueBooleanOrNulls(codes, null);
         for (Viv.KeyValue<@Nullable Boolean> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: true, b: null
         }
      
         // Evaluate result.
         Result result = Viv.run(codes, null);
         pairs = Viv.getKeyValueBooleanOrNulls(result);
         for (Viv.KeyValue<@Nullable Boolean> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: true, b: null
         }
      
         // Evaluate another value directly.
         codes[1] = "\"b\": 10";  // replace
         pairs = Viv.getKeyValueBooleanOrNulls(codes, null);
         for (Viv.KeyValue<@Nullable Boolean> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: true, b: null
         }
       
      Parameters:
      objects - object that may be a HashMap<String, @Nullable Boolean> value
      config - configuration if it is needed, null otherwise
      Returns:
      an array of key-value pairs as KeyValue<@Nullable Boolean>[]. null if evaluation is failed or the evaluated result is not HashMap<String, @Nullable Boolean>.
    • getKeyValueBooleanOrNullsEx

      public static Viv.KeyValue<@Nullable Boolean>[] getKeyValueBooleanOrNullsEx(@Nullable Object... objects) throws VivException
      Gets key-value pairs as an array. (Permit exception) All values are expected as Boolean. When other is given, it is replaced with null.

      For example,

      
         // {"a": true, "b": null}
         String code = "{\"a\": true, \"b\": null}";
      
         // Evaluate directly.
         Viv.KeyValue<@Nullable Boolean>[] pairs =
                 Viv.getKeyValueBooleanOrNullsEx(code);
         for (Viv.KeyValue<@Nullable Boolean> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: true, b: null
         }
      
         // Evaluate result.
         Object object = Viv.runEx(code);
         pairs = Viv.getKeyValueBooleanOrNullsEx(object);
         for (Viv.KeyValue<@Nullable Boolean> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: true, b: null
         }
      
         // Evaluate another value directly.
         pairs = Viv.getKeyValueBooleanOrNullsEx("{\"a\": true, \"b\": 10}");
         for (Viv.KeyValue<@Nullable Boolean> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: true, b: null
         }
       
      Parameters:
      objects - object that may be a HashMap<String, @Nullable Boolean> value
      Returns:
      an array of key-value pairs as KeyValue<@Nullable Boolean>[]
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not HashMap<String, @Nullable Boolean>.
    • getKeyValueBooleanOrNullsEx

      public static Viv.KeyValue<@Nullable Boolean>[] getKeyValueBooleanOrNullsEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets key-value pairs as an array. (Permit exception) All values are expected as Boolean. When other is given, it is replaced with null.

      For example,

      
         // {"a": true, "b": null}
         String[] codes = {"\"a\": true", "\"b\": null"};
      
         // Evaluate directly.
         Viv.KeyValue<@Nullable Boolean>[] pairs =
                 Viv.getKeyValueBooleanOrNullsEx(codes, null);
         for (Viv.KeyValue<@Nullable Boolean> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: true, b: null
         }
      
         // Evaluate result.
         Object object = Viv.runEx(codes, null);
         pairs = Viv.getKeyValueBooleanOrNullsEx(object);
         for (Viv.KeyValue<@Nullable Boolean> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: true, b: null
         }
      
         // Evaluate another value directly.
         codes[1] = "\"b\": 10";  // replace
         pairs = Viv.getKeyValueBooleanOrNullsEx(codes, null);
         for (Viv.KeyValue<@Nullable Boolean> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: true, b: null
         }
       
      Parameters:
      objects - object that may be a HashMap<String, @Nullable Boolean> value
      config - configuration if it is needed, null otherwise
      Returns:
      an array of key-value pairs as KeyValue<@Nullable Boolean>[]
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not HashMap<String, @Nullable Boolean>.
    • getKeyValueIntegers

      public static Viv.KeyValue<Integer> @Nullable [] getKeyValueIntegers(@Nullable Object... objects)
      Gets key-value pairs as an array. All values are expected as Integer. When other is given, null is returned.

      For example,

      
         // {"a": 10, "b": 20}
         String code = "{\"a\": 10, \"b\": 20}";
      
         // Evaluate directly.
         Viv.KeyValue<Integer>[] pairs = Viv.getKeyValueIntegers(code);
         for (Viv.KeyValue<Integer> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: 20
         }
      
         // Evaluate result.
         Result result = Viv.run(code);
         pairs = Viv.getKeyValueIntegers(result);
         for (Viv.KeyValue<Integer> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: 20
         }
      
         // Whole values are lost even if there is only one foreign object.
         code = "{\"a\": 10, \"b\": null}";  // replace
         pairs = Viv.getKeyValueIntegers(code);
         System.out.println(pairs == null);  // true
      
         code = "{\"a\": 10, \"b\": true}";  // replace
         pairs = Viv.getKeyValueIntegers(code);
         System.out.println(pairs == null);  // true
       
      getKeyValueIntegerOrNulls(Object...) is suitable if you want not to lost whole values.
      Parameters:
      objects - object that may be a HashMap<String, Integer> value
      Returns:
      an array of key-value pairs as KeyValue<Integer>[]. null if evaluation is failed or the evaluated result is not HashMap<String, Integer>.
    • getKeyValueIntegers

      public static Viv.KeyValue<Integer> @Nullable [] getKeyValueIntegers(@Nullable Object[] objects, @Nullable Config config)
      Gets key-value pairs as an array. All values are expected as Integer. When other is given, null is returned.

      For example,

      
         // {"a": 10, "b": 20}
         String[] codes = {"\"a\": 10", "\"b\": 20"};
      
         // Evaluate directly.
         Viv.KeyValue<Integer>[] pairs = Viv.getKeyValueIntegers(codes, null);
         for (Viv.KeyValue<Integer> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: 20
         }
      
         // Evaluate result.
         Result result = Viv.run(codes, null);
         pairs = Viv.getKeyValueIntegers(result);
         for (Viv.KeyValue<Integer> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: 20
         }
      
         // Whole values are lost even if there is only one foreign object.
         codes[1] = "\"b\": null";  // replace
         pairs = Viv.getKeyValueIntegers(codes, null);
         System.out.println(pairs == null);  // true
      
         codes[1] = "\"b\": true";  // replace
         pairs = Viv.getKeyValueIntegers(codes, null);
         System.out.println(pairs == null);  // true
       
      getKeyValueIntegerOrNulls(Object[], Config) is suitable if you want not to lost whole values.
      Parameters:
      objects - object that may be a HashMap<String, Integer> value
      config - configuration if it is needed, null otherwise
      Returns:
      an array of key-value pairs as KeyValue<Integer>[]. null if evaluation is failed or the evaluated result is not HashMap<String, Integer>.
    • getKeyValueIntegersEx

      public static Viv.KeyValue<Integer>[] getKeyValueIntegersEx(@Nullable Object... objects) throws VivException
      Gets key-value pairs as an array. (Permit exception) All values are expected as Integer. When other is given, exception is thrown.

      For example,

      
         // {"a": 10, "b": 20}
         String code = "{\"a\": 10, \"b\": 20}";
      
         // Evaluate directly.
         Viv.KeyValue<Integer>[] pairs = Viv.getKeyValueIntegersEx(code);
         for (Viv.KeyValue<Integer> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: 20
         }
      
         // Evaluate result.
         Object object = Viv.runEx(code);
         pairs = Viv.getKeyValueIntegersEx(object);
         for (Viv.KeyValue<Integer> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: 20
         }
      
         // Whole values are lost even if there is only one foreign object.
         code = "{\"a\": 10, \"b\": null}"; // replace
         pairs = Viv.getKeyValueIntegersEx(code);  // Exception is thrown.
      
         code = "{\"a\": 10, \"b\": true}"; // replace
         pairs = Viv.getKeyValueIntegersEx(code);  // Exception is thrown.
       
      getKeyValueIntegerOrNullsEx(Object...) is suitable if you want not to lost whole values.
      Parameters:
      objects - object that may be a HashMap<String, Integer> value
      Returns:
      an array of key-value pairs as KeyValue<Integer>[]
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not HashMap<String, Integer>.
    • getKeyValueIntegersEx

      public static Viv.KeyValue<Integer>[] getKeyValueIntegersEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets key-value pairs as an array. (Permit exception) All values are expected as Integer. When other is given, exception is thrown.

      For example,

      
         // {"a": 10, "b": 20}
         String[] codes = {"\"a\": 10", "\"b\": 20"};
      
         // Evaluate directly.
         Viv.KeyValue<Integer>[] pairs = Viv.getKeyValueIntegersEx(codes, null);
         for (Viv.KeyValue<Integer> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: 20
         }
      
         // Evaluate result.
         Object object = Viv.runEx(codes, null);
         pairs = Viv.getKeyValueIntegersEx(object);
         for (Viv.KeyValue<Integer> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: 20
         }
      
         // Whole values are lost even if there is only one foreign object.
         codes[1] = "\"b\": null";  // replace
         pairs = Viv.getKeyValueIntegersEx(codes, null);  // Exception is thrown.
      
         codes[1] = "\"b\": true";  // replace
         pairs = Viv.getKeyValueIntegersEx(codes, null);  // Exception is thrown.
       
      getKeyValueIntegerOrNullsEx(Object[], Config) is suitable if you want not to lost whole values.
      Parameters:
      objects - object that may be a HashMap<String, Integer> value
      config - configuration if it is needed, null otherwise
      Returns:
      an array of key-value pairs as KeyValue<Integer>[]
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not HashMap<String, Integer>.
    • getKeyValueIntegerOrNulls

      public static Viv.KeyValue<@Nullable Integer> @Nullable [] getKeyValueIntegerOrNulls(@Nullable Object... objects)
      Gets key-value pairs as an array. All values are expected as Integer. When other is given, it is replaced with null.

      For example,

      
         // {"a": 10, "b": null}
         String code = "{\"a\": 10, \"b\": null}";
      
         // Evaluate directly.
         Viv.KeyValue<@Nullable Integer>[] pairs =
                 Viv.getKeyValueIntegerOrNulls(code);
         for (Viv.KeyValue<@Nullable Integer> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: null
         }
      
         // Evaluate result.
         Result result = Viv.run(code);
         pairs = Viv.getKeyValueIntegerOrNulls(result);
         for (Viv.KeyValue<@Nullable Integer> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: null
         }
      
         // Evaluate another value directly.
         pairs = Viv.getKeyValueIntegerOrNulls("{\"a\": 10, \"b\": true}");
         for (Viv.KeyValue<@Nullable Integer> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: null
         }
       
      Parameters:
      objects - object that may be a HashMap<String, @Nullable Integer> value
      Returns:
      an array of key-value pairs as KeyValue<@Nullable Integer>[]. null if evaluation is failed or the evaluated result is not HashMap<String, @Nullable Integer>.
    • getKeyValueIntegerOrNulls

      public static Viv.KeyValue<@Nullable Integer> @Nullable [] getKeyValueIntegerOrNulls(@Nullable Object[] objects, @Nullable Config config)
      Gets key-value pairs as an array. All values are expected as Integer. When other is given, it is replaced with null.

      For example,

      
         // {"a": 10, "b": null}
         String[] codes = {"\"a\": 10", "\"b\": null"};
      
         // Evaluate directly.
         Viv.KeyValue<@Nullable Integer>[] pairs =
                 Viv.getKeyValueIntegerOrNulls(codes, null);
         for (Viv.KeyValue<@Nullable Integer> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: null
         }
      
         // Evaluate result.
         Result result = Viv.run(codes, null);
         pairs = Viv.getKeyValueIntegerOrNulls(result);
         for (Viv.KeyValue<@Nullable Integer> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: null
         }
      
         // Evaluate another value directly.
         codes[1] = "\"b\": true";  // replace
         pairs = Viv.getKeyValueIntegerOrNulls(codes, null);
         for (Viv.KeyValue<@Nullable Integer> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: null
         }
       
      Parameters:
      objects - object that may be a HashMap<String, @Nullable Integer> value
      config - configuration if it is needed, null otherwise
      Returns:
      an array of key-value pairs as KeyValue<@Nullable Integer>[]. null if evaluation is failed or the evaluated result is not HashMap<String, @Nullable Integer>.
    • getKeyValueIntegerOrNullsEx

      public static Viv.KeyValue<@Nullable Integer>[] getKeyValueIntegerOrNullsEx(@Nullable Object... objects) throws VivException
      Gets key-value pairs as an array. (Permit exception) All values are expected as Integer. When other is given, it is replaced with null.

      For example,

      
         // {"a": 10, "b": null}
         String code = "{\"a\": 10, \"b\": null}";
      
         // Evaluate directly.
         Viv.KeyValue<@Nullable Integer>[] pairs =
                 Viv.getKeyValueIntegerOrNullsEx(code);
         for (Viv.KeyValue<@Nullable Integer> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: null
         }
      
         // Evaluate result.
         Object object = Viv.runEx(code);
         pairs = Viv.getKeyValueIntegerOrNullsEx(object);
         for (Viv.KeyValue<@Nullable Integer> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: null
         }
      
         // Evaluate another value directly.
         pairs = Viv.getKeyValueIntegerOrNullsEx("{\"a\": 10, \"b\": true}");
         for (Viv.KeyValue<@Nullable Integer> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: null
         }
       
      Parameters:
      objects - object that may be a HashMap<String, @Nullable Integer> value
      Returns:
      an array of key-value pairs as KeyValue<@Nullable Integer>[]
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not HashMap<String, @Nullable Integer>.
    • getKeyValueIntegerOrNullsEx

      public static Viv.KeyValue<@Nullable Integer>[] getKeyValueIntegerOrNullsEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets key-value pairs as an array. (Permit exception) All values are expected as Integer. When other is given, it is replaced with null.

      For example,

      
         // {"a": 10, "b": null}
         String[] codes = {"\"a\": 10", "\"b\": null"};
      
         // Evaluate directly.
         Viv.KeyValue<@Nullable Integer>[] pairs =
                 Viv.getKeyValueIntegerOrNullsEx(codes, null);
         for (Viv.KeyValue<@Nullable Integer> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: null
         }
      
         // Evaluate result.
         Object object = Viv.runEx(codes, null);
         pairs = Viv.getKeyValueIntegerOrNullsEx(object);
         for (Viv.KeyValue<@Nullable Integer> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: null
         }
      
         // Evaluate another value directly.
         codes[1] = "\"b\": true";  // replace
         pairs = Viv.getKeyValueIntegerOrNullsEx(codes, null);
         for (Viv.KeyValue<@Nullable Integer> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: null
         }
       
      Parameters:
      objects - object that may be a HashMap<String, @Nullable Integer> value
      config - configuration if it is needed, null otherwise
      Returns:
      an array of key-value pairs as KeyValue<@Nullable Integer>[]
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not HashMap<String, @Nullable Integer>.
    • getKeyValueLongs

      public static Viv.KeyValue<Long> @Nullable [] getKeyValueLongs(@Nullable Object... objects)
      Gets key-value pairs as an array. All values are expected as Long. When other is given, null is returned.

      For example,

      
         // {"a": 10, "b": 20}
         String code = "{\"a\": 10, \"b\": 20}";
      
         // Evaluate directly.
         Viv.KeyValue<Long>[] pairs = Viv.getKeyValueLongs(code);
         for (Viv.KeyValue<Long> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: 20
         }
      
         // Evaluate result.
         Result result = Viv.run(code);
         pairs = Viv.getKeyValueLongs(result);
         for (Viv.KeyValue<Long> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: 20
         }
      
         // Whole values are lost even if there is only one foreign object.
         code = "{\"a\": 10, \"b\": null}";  // replace
         pairs = Viv.getKeyValueLongs(code);
         System.out.println(pairs == null);  // true
      
         code = "{\"a\": 10, \"b\": true}";  // replace
         pairs = Viv.getKeyValueLongs(code);
         System.out.println(pairs == null);  // true
       
      getKeyValueLongOrNulls(Object...) is suitable if you want not to lost whole values.
      Parameters:
      objects - object that may be a HashMap<String, Long> value
      Returns:
      an array of key-value pairs as KeyValue<Long>[]. null if evaluation is failed or the evaluated result is not HashMap<String, Long>.
    • getKeyValueLongs

      public static Viv.KeyValue<Long> @Nullable [] getKeyValueLongs(@Nullable Object[] objects, @Nullable Config config)
      Gets key-value pairs as an array. All values are expected as Long. When other is given, null is returned.

      For example,

      
         // {"a": 10, "b": 20}
         String[] codes = {"\"a\": 10", "\"b\": 20"};
      
         // Evaluate directly.
         Viv.KeyValue<Long>[] pairs = Viv.getKeyValueLongs(codes, null);
         for (Viv.KeyValue<Long> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: 20
         }
      
         // Evaluate result.
         Result result = Viv.run(codes, null);
         pairs = Viv.getKeyValueLongs(result);
         for (Viv.KeyValue<Long> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: 20
         }
      
         // Whole values are lost even if there is only one foreign object.
         codes[1] = "\"b\": null";  // replace
         pairs = Viv.getKeyValueLongs(codes, null);
         System.out.println(pairs == null);  // true
      
         codes[1] = "\"b\": true";  // replace
         pairs = Viv.getKeyValueLongs(codes, null);
         System.out.println(pairs == null);  // true
       
      getKeyValueLongOrNulls(Object[], Config) is suitable if you want not to lost whole values.
      Parameters:
      objects - object that may be a HashMap<String, Long> value
      config - configuration if it is needed, null otherwise
      Returns:
      an array of key-value pairs as KeyValue<Long>[]. null if evaluation is failed or the evaluated result is not HashMap<String, Long>.
    • getKeyValueLongsEx

      public static Viv.KeyValue<Long>[] getKeyValueLongsEx(@Nullable Object... objects) throws VivException
      Gets key-value pairs as an array. (Permit exception) All values are expected as Long. When other is given, exception is thrown.

      For example,

      
         // {"a": 10, "b": 20}
         String code = "{\"a\": 10, \"b\": 20}";
      
         // Evaluate directly.
         Viv.KeyValue<Long>[] pairs = Viv.getKeyValueLongsEx(code);
         for (Viv.KeyValue<Long> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: 20
         }
      
         // Evaluate result.
         Object object = Viv.runEx(code);
         pairs = Viv.getKeyValueLongsEx(object);
         for (Viv.KeyValue<Long> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: 20
         }
      
         // Whole values are lost even if there is only one foreign object.
         code = "{\"a\": 10, \"b\": null}"; // replace
         pairs = Viv.getKeyValueLongsEx(code);  // Exception is thrown.
      
         code = "{\"a\": 10, \"b\": true}"; // replace
         pairs = Viv.getKeyValueLongsEx(code);  // Exception is thrown.
       
      getKeyValueLongOrNullsEx(Object...) is suitable if you want not to lost whole values.
      Parameters:
      objects - object that may be a HashMap<String, Long> value
      Returns:
      an array of key-value pairs as KeyValue<Long>[]
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not HashMap<String, Long>.
    • getKeyValueLongsEx

      public static Viv.KeyValue<Long>[] getKeyValueLongsEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets key-value pairs as an array. (Permit exception) All values are expected as Long. When other is given, exception is thrown.

      For example,

      
         // {"a": 10, "b": 20}
         String[] codes = {"\"a\": 10", "\"b\": 20"};
      
         // Evaluate directly.
         Viv.KeyValue<Long>[] pairs = Viv.getKeyValueLongsEx(codes, null);
         for (Viv.KeyValue<Long> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: 20
         }
      
         // Evaluate result.
         Object object = Viv.runEx(codes, null);
         pairs = Viv.getKeyValueLongsEx(object);
         for (Viv.KeyValue<Long> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: 20
         }
      
         // Whole values are lost even if there is only one foreign object.
         codes[1] = "\"b\": null";  // replace
         pairs = Viv.getKeyValueLongsEx(codes, null);  // Exception is thrown.
      
         codes[1] = "\"b\": true";  // replace
         pairs = Viv.getKeyValueLongsEx(codes, null);  // Exception is thrown.
       
      getKeyValueLongOrNullsEx(Object[], Config) is suitable if you want not to lost whole values.
      Parameters:
      objects - object that may be a HashMap<String, Long> value
      config - configuration if it is needed, null otherwise
      Returns:
      an array of key-value pairs as KeyValue<Long>[]
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not HashMap<String, Long>.
    • getKeyValueLongOrNulls

      public static Viv.KeyValue<@Nullable Long> @Nullable [] getKeyValueLongOrNulls(@Nullable Object... objects)
      Gets key-value pairs as an array. All values are expected as Long. When other is given, it is replaced with null.

      For example,

      
         // {"a": 10, "b": null}
         String code = "{\"a\": 10, \"b\": null}";
      
         // Evaluate directly.
         Viv.KeyValue<@Nullable Long>[] pairs =
                 Viv.getKeyValueLongOrNulls(code);
         for (Viv.KeyValue<@Nullable Long> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: null
         }
      
         // Evaluate result.
         Result result = Viv.run(code);
         pairs = Viv.getKeyValueLongOrNulls(result);
         for (Viv.KeyValue<@Nullable Long> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: null
         }
      
         // Evaluate another value directly.
         pairs = Viv.getKeyValueLongOrNulls("{\"a\": 10, \"b\": true}");
         for (Viv.KeyValue<@Nullable Long> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: null
         }
       
      Parameters:
      objects - object that may be a HashMap<String, @Nullable Long> value
      Returns:
      an array of key-value pairs as KeyValue<@Nullable Long>[]. null if evaluation is failed or the evaluated result is not HashMap<String, @Nullable Long>.
    • getKeyValueLongOrNulls

      public static Viv.KeyValue<@Nullable Long> @Nullable [] getKeyValueLongOrNulls(@Nullable Object[] objects, @Nullable Config config)
      Gets key-value pairs as an array. All values are expected as Long. When other is given, it is replaced with null.

      For example,

      
         // {"a": 10, "b": null}
         String[] codes = {"\"a\": 10", "\"b\": null"};
      
         // Evaluate directly.
         Viv.KeyValue<@Nullable Long>[] pairs =
                 Viv.getKeyValueLongOrNulls(codes, null);
         for (Viv.KeyValue<@Nullable Long> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: null
         }
      
         // Evaluate result.
         Result result = Viv.run(codes, null);
         pairs = Viv.getKeyValueLongOrNulls(result);
         for (Viv.KeyValue<@Nullable Long> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: null
         }
      
         // Evaluate another value directly.
         codes[1] = "\"b\": true";  // replace
         pairs = Viv.getKeyValueLongOrNulls(codes, null);
         for (Viv.KeyValue<@Nullable Long> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: null
         }
       
      Parameters:
      objects - object that may be a HashMap<String, @Nullable Long> value
      config - configuration if it is needed, null otherwise
      Returns:
      an array of key-value pairs as KeyValue<@Nullable Long>[]. null if evaluation is failed or the evaluated result is not HashMap<String, @Nullable Long>.
    • getKeyValueLongOrNullsEx

      public static Viv.KeyValue<@Nullable Long>[] getKeyValueLongOrNullsEx(@Nullable Object... objects) throws VivException
      Gets key-value pairs as an array. (Permit exception) All values are expected as Long. When other is given, it is replaced with null.

      For example,

      
         // {"a": 10, "b": null}
         String code = "{\"a\": 10, \"b\": null}";
      
         // Evaluate directly.
         Viv.KeyValue<@Nullable Long>[] pairs =
                 Viv.getKeyValueLongOrNullsEx(code);
         for (Viv.KeyValue<@Nullable Long> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: null
         }
      
         // Evaluate result.
         Object object = Viv.runEx(code);
         pairs = Viv.getKeyValueLongOrNullsEx(object);
         for (Viv.KeyValue<@Nullable Long> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: null
         }
      
         // Evaluate another value directly.
         pairs = Viv.getKeyValueLongOrNullsEx("{\"a\": 10, \"b\": true}");
         for (Viv.KeyValue<@Nullable Long> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: null
         }
       
      Parameters:
      objects - object that may be a HashMap<String, @Nullable Long> value
      Returns:
      an array of key-value pairs as KeyValue<@Nullable Long>[]
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not HashMap<String, @Nullable Long>.
    • getKeyValueLongOrNullsEx

      public static Viv.KeyValue<@Nullable Long>[] getKeyValueLongOrNullsEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets key-value pairs as an array. (Permit exception) All values are expected as Long. When other is given, it is replaced with null.

      For example,

      
         // {"a": 10, "b": null}
         String[] codes = {"\"a\": 10", "\"b\": null"};
      
         // Evaluate directly.
         Viv.KeyValue<@Nullable Long>[] pairs =
                 Viv.getKeyValueLongOrNullsEx(codes, null);
         for (Viv.KeyValue<@Nullable Long> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: null
         }
      
         // Evaluate result.
         Object object = Viv.runEx(codes, null);
         pairs = Viv.getKeyValueLongOrNullsEx(object);
         for (Viv.KeyValue<@Nullable Long> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: null
         }
      
         // Evaluate another value directly.
         codes[1] = "\"b\": true";  // replace
         pairs = Viv.getKeyValueLongOrNullsEx(codes, null);
         for (Viv.KeyValue<@Nullable Long> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 10, b: null
         }
       
      Parameters:
      objects - object that may be a HashMap<String, @Nullable Long> value
      config - configuration if it is needed, null otherwise
      Returns:
      an array of key-value pairs as KeyValue<@Nullable Long>[]
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not HashMap<String, @Nullable Long>.
    • getKeyValueFloats

      public static Viv.KeyValue<Float> @Nullable [] getKeyValueFloats(@Nullable Object... objects)
      Gets key-value pairs as an array. All values are expected as Float. When other is given, null is returned.

      For example,

      
         // {"a": 1.0, "b": 2.5}
         String code = "{\"a\": 1.0, \"b\": 2.5}";
      
         // Evaluate directly.
         Viv.KeyValue<Float>[] pairs = Viv.getKeyValueFloats(code);
         for (Viv.KeyValue<Float> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: 2.5
         }
      
         // Evaluate result.
         Result result = Viv.run(code);
         pairs = Viv.getKeyValueFloats(result);
         for (Viv.KeyValue<Float> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: 2.5
         }
      
         // Whole values are lost even if there is only one foreign object.
         code = "{\"a\": 1.0, \"b\": null}";  // replace
         pairs = Viv.getKeyValueFloats(code);
         System.out.println(pairs == null);  // true
      
         code = "{\"a\": 1.0, \"b\": true}";  // replace
         pairs = Viv.getKeyValueFloats(code);
         System.out.println(pairs == null);  // true
       
      getKeyValueFloatOrNulls(Object...) is suitable if you want not to lost whole values.
      Parameters:
      objects - object that may be a HashMap<String, Float> value
      Returns:
      an array of key-value pairs as KeyValue<Float>[]. null if evaluation is failed or the evaluated result is not HashMap<String, Float>.
    • getKeyValueFloats

      public static Viv.KeyValue<Float> @Nullable [] getKeyValueFloats(@Nullable Object[] objects, @Nullable Config config)
      Gets key-value pairs as an array. All values are expected as Float. When other is given, null is returned.

      For example,

      
         // {"a": 1.0, "b": 2.5}
         String[] codes = {"\"a\": 1.0", "\"b\": 2.5"};
      
         // Evaluate directly.
         Viv.KeyValue<Float>[] pairs = Viv.getKeyValueFloats(codes, null);
         for (Viv.KeyValue<Float> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: 2.5
         }
      
         // Evaluate result.
         Result result = Viv.run(codes, null);
         pairs = Viv.getKeyValueFloats(result);
         for (Viv.KeyValue<Float> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: 2.5
         }
      
         // Whole values are lost even if there is only one foreign object.
         codes[1] = "\"b\": null";  // replace
         pairs = Viv.getKeyValueFloats(codes, null);
         System.out.println(pairs == null);  // true
      
         codes[1] = "\"b\": true";  // replace
         pairs = Viv.getKeyValueFloats(codes, null);
         System.out.println(pairs == null);  // true
       
      getKeyValueFloatOrNulls(Object[], Config) is suitable if you want not to lost whole values.
      Parameters:
      objects - object that may be a HashMap<String, Float> value
      config - configuration if it is needed, null otherwise
      Returns:
      an array of key-value pairs as KeyValue<Float>[]. null if evaluation is failed or the evaluated result is not HashMap<String, Float>.
    • getKeyValueFloatsEx

      public static Viv.KeyValue<Float>[] getKeyValueFloatsEx(@Nullable Object... objects) throws VivException
      Gets key-value pairs as an array. (Permit exception) All values are expected as Float. When other is given, exception is thrown.

      For example,

      
         // {"a": 1.0, "b": 2.5}
         String code = "{\"a\": 1.0, \"b\": 2.5}";
      
         // Evaluate directly.
         Viv.KeyValue<Float>[] pairs = Viv.getKeyValueFloatsEx(code);
         for (Viv.KeyValue<Float> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: 2.5
         }
      
         // Evaluate result.
         Object object = Viv.runEx(code);
         pairs = Viv.getKeyValueFloatsEx(object);
         for (Viv.KeyValue<Float> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: 2.5
         }
      
         // Whole values are lost even if there is only one foreign object.
         code = "{\"a\": 1.0, \"b\": null}"; // replace
         pairs = Viv.getKeyValueFloatsEx(code);  // Exception is thrown.
      
         code = "{\"a\": 1.0, \"b\": true}"; // replace
         pairs = Viv.getKeyValueFloatsEx(code);  // Exception is thrown.
       
      getKeyValueFloatOrNullsEx(Object...) is suitable if you want not to lost whole values.
      Parameters:
      objects - object that may be a HashMap<String, Float> value
      Returns:
      an array of key-value pairs as KeyValue<Float>[]
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not HashMap<String, Float>.
    • getKeyValueFloatsEx

      public static Viv.KeyValue<Float>[] getKeyValueFloatsEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets key-value pairs as an array. (Permit exception) All values are expected as Float. When other is given, exception is thrown.

      For example,

      
         // {"a": 1.0, "b": 2.5}
         String[] codes = {"\"a\": 1.0", "\"b\": 2.5"};
      
         // Evaluate directly.
         Viv.KeyValue<Float>[] pairs = Viv.getKeyValueFloatsEx(codes, null);
         for (Viv.KeyValue<Float> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: 2.5
         }
      
         // Evaluate result.
         Object object = Viv.runEx(codes, null);
         pairs = Viv.getKeyValueFloatsEx(object);
         for (Viv.KeyValue<Float> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: 2.5
         }
      
         // Whole values are lost even if there is only one foreign object.
         codes[1] = "\"b\": null";  // replace
         pairs = Viv.getKeyValueFloatsEx(codes, null);  // Exception is thrown.
      
         codes[1] = "\"b\": true";  // replace
         pairs = Viv.getKeyValueFloatsEx(codes, null);  // Exception is thrown.
       
      getKeyValueFloatOrNullsEx(Object[], Config) is suitable if you want not to lost whole values.
      Parameters:
      objects - object that may be a HashMap<String, Float> value
      config - configuration if it is needed, null otherwise
      Returns:
      an array of key-value pairs as KeyValue<Float>[]
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not HashMap<String, Float>.
    • getKeyValueFloatOrNulls

      public static Viv.KeyValue<@Nullable Float> @Nullable [] getKeyValueFloatOrNulls(@Nullable Object... objects)
      Gets key-value pairs as an array. All values are expected as Float. When other is given, it is replaced with null.

      For example,

      
         // {"a": 1.0, "b": null}
         String code = "{\"a\": 1.0, \"b\": null}";
      
         // Evaluate directly.
         Viv.KeyValue<@Nullable Float>[] pairs =
                 Viv.getKeyValueFloatOrNulls(code);
         for (Viv.KeyValue<@Nullable Float> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: null
         }
      
         // Evaluate result.
         Result result = Viv.run(code);
         pairs = Viv.getKeyValueFloatOrNulls(result);
         for (Viv.KeyValue<@Nullable Float> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: null
         }
      
         // Evaluate another value directly.
         pairs = Viv.getKeyValueFloatOrNulls("{\"a\": 1.0, \"b\": true}");
         for (Viv.KeyValue<@Nullable Float> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: null
         }
       
      Parameters:
      objects - object that may be a HashMap<String, @Nullable Float> value
      Returns:
      an array of key-value pairs as KeyValue<@Nullable Float>[]. null if evaluation is failed or the evaluated result is not HashMap<String, @Nullable Float>.
    • getKeyValueFloatOrNulls

      public static Viv.KeyValue<@Nullable Float> @Nullable [] getKeyValueFloatOrNulls(@Nullable Object[] objects, @Nullable Config config)
      Gets key-value pairs as an array. All values are expected as Float. When other is given, it is replaced with null.

      For example,

      
         // {"a": 1.0, "b": null}
         String[] codes = {"\"a\": 1.0", "\"b\": null"};
      
         // Evaluate directly.
         Viv.KeyValue<@Nullable Float>[] pairs =
                 Viv.getKeyValueFloatOrNulls(codes, null);
         for (Viv.KeyValue<@Nullable Float> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: null
         }
      
         // Evaluate result.
         Result result = Viv.run(codes, null);
         pairs = Viv.getKeyValueFloatOrNulls(result);
         for (Viv.KeyValue<@Nullable Float> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: null
         }
      
         // Evaluate another value directly.
         codes[1] = "\"b\": true";  // replace
         pairs = Viv.getKeyValueFloatOrNulls(codes, null);
         for (Viv.KeyValue<@Nullable Float> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: null
         }
       
      Parameters:
      objects - object that may be a HashMap<String, @Nullable Float> value
      config - configuration if it is needed, null otherwise
      Returns:
      an array of key-value pairs as KeyValue<@Nullable Float>[]. null if evaluation is failed or the evaluated result is not HashMap<String, @Nullable Float>.
    • getKeyValueFloatOrNullsEx

      public static Viv.KeyValue<@Nullable Float>[] getKeyValueFloatOrNullsEx(@Nullable Object... objects) throws VivException
      Gets key-value pairs as an array. (Permit exception) All values are expected as Float. When other is given, it is replaced with null.

      For example,

      
         // {"a": 1.0, "b": null}
         String code = "{\"a\": 1.0, \"b\": null}";
      
         // Evaluate directly.
         Viv.KeyValue<@Nullable Float>[] pairs =
                 Viv.getKeyValueFloatOrNullsEx(code);
         for (Viv.KeyValue<@Nullable Float> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: null
         }
      
         // Evaluate result.
         Object object = Viv.runEx(code);
         pairs = Viv.getKeyValueFloatOrNullsEx(object);
         for (Viv.KeyValue<@Nullable Float> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: null
         }
      
         // Evaluate another value directly.
         pairs = Viv.getKeyValueFloatOrNullsEx("{\"a\": 1.0, \"b\": true}");
         for (Viv.KeyValue<@Nullable Float> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: null
         }
       
      Parameters:
      objects - object that may be a HashMap<String, @Nullable Float> value
      Returns:
      an array of key-value pairs as KeyValue<@Nullable Float>[]
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not HashMap<String, @Nullable Float>.
    • getKeyValueFloatOrNullsEx

      public static Viv.KeyValue<@Nullable Float>[] getKeyValueFloatOrNullsEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets key-value pairs as an array. (Permit exception) All values are expected as Float. When other is given, it is replaced with null.

      For example,

      
         // {"a": 1.0, "b": null}
         String[] codes = {"\"a\": 1.0", "\"b\": null"};
      
         // Evaluate directly.
         Viv.KeyValue<@Nullable Float>[] pairs =
                 Viv.getKeyValueFloatOrNullsEx(codes, null);
         for (Viv.KeyValue<@Nullable Float> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: null
         }
      
         // Evaluate result.
         Object object = Viv.runEx(codes, null);
         pairs = Viv.getKeyValueFloatOrNullsEx(object);
         for (Viv.KeyValue<@Nullable Float> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: null
         }
      
         // Evaluate another value directly.
         codes[1] = "\"b\": true";  // replace
         pairs = Viv.getKeyValueFloatOrNullsEx(codes, null);
         for (Viv.KeyValue<@Nullable Float> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: null
         }
       
      Parameters:
      objects - object that may be a HashMap<String, @Nullable Float> value
      config - configuration if it is needed, null otherwise
      Returns:
      an array of key-value pairs as KeyValue<@Nullable Float>[]
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not HashMap<String, @Nullable Float>.
    • getKeyValueDoubles

      public static Viv.KeyValue<Double> @Nullable [] getKeyValueDoubles(@Nullable Object... objects)
      Gets key-value pairs as an array. All values are expected as Double. When other is given, null is returned.

      For example,

      
         // {"a": 1.0, "b": 2.5}
         String code = "{\"a\": 1.0, \"b\": 2.5}";
      
         // Evaluate directly.
         Viv.KeyValue<Double>[] pairs = Viv.getKeyValueDoubles(code);
         for (Viv.KeyValue<Double> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: 2.5
         }
      
         // Evaluate result.
         Result result = Viv.run(code);
         pairs = Viv.getKeyValueDoubles(result);
         for (Viv.KeyValue<Double> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: 2.5
         }
      
         // Whole values are lost even if there is only one foreign object.
         code = "{\"a\": 1.0, \"b\": null}";  // replace
         pairs = Viv.getKeyValueDoubles(code);
         System.out.println(pairs == null);  // true
      
         code = "{\"a\": 1.0, \"b\": true}";  // replace
         pairs = Viv.getKeyValueDoubles(code);
         System.out.println(pairs == null);  // true
       
      getKeyValueDoubleOrNulls(Object...) is suitable if you want not to lost whole values.
      Parameters:
      objects - object that may be a HashMap<String, Double> value
      Returns:
      an array of key-value pairs as KeyValue<Double>[]. null if evaluation is failed or the evaluated result is not HashMap<String, Double>.
    • getKeyValueDoubles

      public static Viv.KeyValue<Double> @Nullable [] getKeyValueDoubles(@Nullable Object[] objects, @Nullable Config config)
      Gets key-value pairs as an array. All values are expected as Double. When other is given, null is returned.

      For example,

      
         // {"a": 1.0, "b": 2.5}
         String[] codes = {"\"a\": 1.0", "\"b\": 2.5"};
      
         // Evaluate directly.
         Viv.KeyValue<Double>[] pairs = Viv.getKeyValueDoubles(codes, null);
         for (Viv.KeyValue<Double> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: 2.5
         }
      
         // Evaluate result.
         Result result = Viv.run(codes, null);
         pairs = Viv.getKeyValueDoubles(result);
         for (Viv.KeyValue<Double> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: 2.5
         }
      
         // Whole values are lost even if there is only one foreign object.
         codes[1] = "\"b\": null";  // replace
         pairs = Viv.getKeyValueDoubles(codes, null);
         System.out.println(pairs == null);  // true
      
         codes[1] = "\"b\": true";  // replace
         pairs = Viv.getKeyValueDoubles(codes, null);
         System.out.println(pairs == null);  // true
       
      getKeyValueDoubleOrNulls(Object[], Config) is suitable if you want not to lost whole values.
      Parameters:
      objects - object that may be a HashMap<String, Double> value
      config - configuration if it is needed, null otherwise
      Returns:
      an array of key-value pairs as KeyValue<Double>[]. null if evaluation is failed or the evaluated result is not HashMap<String, Double>.
    • getKeyValueDoublesEx

      public static Viv.KeyValue<Double>[] getKeyValueDoublesEx(@Nullable Object... objects) throws VivException
      Gets key-value pairs as an array. (Permit exception) All values are expected as Double. When other is given, exception is thrown.

      For example,

      
         // {"a": 1.0, "b": 2.5}
         String code = "{\"a\": 1.0, \"b\": 2.5}";
      
         // Evaluate directly.
         Viv.KeyValue<Double>[] pairs = Viv.getKeyValueDoublesEx(code);
         for (Viv.KeyValue<Double> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: 2.5
         }
      
         // Evaluate result.
         Object object = Viv.runEx(code);
         pairs = Viv.getKeyValueDoublesEx(object);
         for (Viv.KeyValue<Double> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: 2.5
         }
      
         // Whole values are lost even if there is only one foreign object.
         code = "{\"a\": 1.0, \"b\": null}"; // replace
         pairs = Viv.getKeyValueDoublesEx(code);  // Exception is thrown.
      
         code = "{\"a\": 1.0, \"b\": true}"; // replace
         pairs = Viv.getKeyValueDoublesEx(code);  // Exception is thrown.
       
      getKeyValueDoubleOrNullsEx(Object...) is suitable if you want not to lost whole values.
      Parameters:
      objects - object that may be a HashMap<String, Double> value
      Returns:
      an array of key-value pairs as KeyValue<Double>[]
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not HashMap<String, Double>.
    • getKeyValueDoublesEx

      public static Viv.KeyValue<Double>[] getKeyValueDoublesEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets key-value pairs as an array. (Permit exception) All values are expected as Double. When other is given, exception is thrown.

      For example,

      
         // {"a": 1.0, "b": 2.5}
         String[] codes = {"\"a\": 1.0", "\"b\": 2.5"};
      
         // Evaluate directly.
         Viv.KeyValue<Double>[] pairs = Viv.getKeyValueDoublesEx(codes, null);
         for (Viv.KeyValue<Double> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: 2.5
         }
      
         // Evaluate result.
         Object object = Viv.runEx(codes, null);
         pairs = Viv.getKeyValueDoublesEx(object);
         for (Viv.KeyValue<Double> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: 2.5
         }
      
         // Whole values are lost even if there is only one foreign object.
         codes[1] = "\"b\": null";  // replace
         pairs = Viv.getKeyValueDoublesEx(codes, null);  // Exception is thrown.
      
         codes[1] = "\"b\": true";  // replace
         pairs = Viv.getKeyValueDoublesEx(codes, null);  // Exception is thrown.
       
      getKeyValueDoubleOrNullsEx(Object[], Config) is suitable if you want not to lost whole values.
      Parameters:
      objects - object that may be a HashMap<String, Double> value
      config - configuration if it is needed, null otherwise
      Returns:
      an array of key-value pairs as KeyValue<Double>[]
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not HashMap<String, Double>.
    • getKeyValueDoubleOrNulls

      public static Viv.KeyValue<@Nullable Double> @Nullable [] getKeyValueDoubleOrNulls(@Nullable Object... objects)
      Gets key-value pairs as an array. All values are expected as Double. When other is given, it is replaced with null.

      For example,

      
         // {"a": 1.0, "b": null}
         String code = "{\"a\": 1.0, \"b\": null}";
      
         // Evaluate directly.
         Viv.KeyValue<@Nullable Double>[] pairs =
                 Viv.getKeyValueDoubleOrNulls(code);
         for (Viv.KeyValue<@Nullable Double> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: null
         }
      
         // Evaluate result.
         Result result = Viv.run(code);
         pairs = Viv.getKeyValueDoubleOrNulls(result);
         for (Viv.KeyValue<@Nullable Double> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: null
         }
      
         // Evaluate another value directly.
         pairs = Viv.getKeyValueDoubleOrNulls("{\"a\": 1.0, \"b\": true}");
         for (Viv.KeyValue<@Nullable Double> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: null
         }
       
      Parameters:
      objects - object that may be a HashMap<String, @Nullable Double> value
      Returns:
      an array of key-value pairs as KeyValue<@Nullable Double>[]. null if evaluation is failed or the evaluated result is not HashMap<String, @Nullable Double>.
    • getKeyValueDoubleOrNulls

      public static Viv.KeyValue<@Nullable Double> @Nullable [] getKeyValueDoubleOrNulls(@Nullable Object[] objects, @Nullable Config config)
      Gets key-value pairs as an array. All values are expected as Double. When other is given, it is replaced with null.

      For example,

      
         // {"a": 1.0, "b": null}
         String[] codes = {"\"a\": 1.0", "\"b\": null"};
      
         // Evaluate directly.
         Viv.KeyValue<@Nullable Double>[] pairs =
                 Viv.getKeyValueDoubleOrNulls(codes, null);
         for (Viv.KeyValue<@Nullable Double> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: null
         }
      
         // Evaluate result.
         Result result = Viv.run(codes, null);
         pairs = Viv.getKeyValueDoubleOrNulls(result);
         for (Viv.KeyValue<@Nullable Double> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: null
         }
      
         // Evaluate another value directly.
         codes[1] = "\"b\": true";  // replace
         pairs = Viv.getKeyValueDoubleOrNulls(codes, null);
         for (Viv.KeyValue<@Nullable Double> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: null
         }
       
      Parameters:
      objects - object that may be a HashMap<String, @Nullable Double> value
      config - configuration if it is needed, null otherwise
      Returns:
      an array of key-value pairs as KeyValue<@Nullable Double>[]. null if evaluation is failed or the evaluated result is not HashMap<String, @Nullable Double>.
    • getKeyValueDoubleOrNullsEx

      public static Viv.KeyValue<@Nullable Double>[] getKeyValueDoubleOrNullsEx(@Nullable Object... objects) throws VivException
      Gets key-value pairs as an array. (Permit exception) All values are expected as Double. When other is given, it is replaced with null.

      For example,

      
         // {"a": 1.0, "b": null}
         String code = "{\"a\": 1.0, \"b\": null}";
      
         // Evaluate directly.
         Viv.KeyValue<@Nullable Double>[] pairs =
                 Viv.getKeyValueDoubleOrNullsEx(code);
         for (Viv.KeyValue<@Nullable Double> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: null
         }
      
         // Evaluate result.
         Object object = Viv.runEx(code);
         pairs = Viv.getKeyValueDoubleOrNullsEx(object);
         for (Viv.KeyValue<@Nullable Double> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: null
         }
      
         // Evaluate another value directly.
         pairs = Viv.getKeyValueDoubleOrNullsEx("{\"a\": 1.0, \"b\": true}");
         for (Viv.KeyValue<@Nullable Double> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: null
         }
       
      Parameters:
      objects - object that may be a HashMap<String, @Nullable Double> value
      Returns:
      an array of key-value pairs as KeyValue<@Nullable Double>[]
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not HashMap<String, @Nullable Double>.
    • getKeyValueDoubleOrNullsEx

      public static Viv.KeyValue<@Nullable Double>[] getKeyValueDoubleOrNullsEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets key-value pairs as an array. (Permit exception) All values are expected as Double. When other is given, it is replaced with null.

      For example,

      
         // {"a": 1.0, "b": null}
         String[] codes = {"\"a\": 1.0", "\"b\": null"};
      
         // Evaluate directly.
         Viv.KeyValue<@Nullable Double>[] pairs =
                 Viv.getKeyValueDoubleOrNullsEx(codes, null);
         for (Viv.KeyValue<@Nullable Double> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: null
         }
      
         // Evaluate result.
         Object object = Viv.runEx(codes, null);
         pairs = Viv.getKeyValueDoubleOrNullsEx(object);
         for (Viv.KeyValue<@Nullable Double> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: null
         }
      
         // Evaluate another value directly.
         codes[1] = "\"b\": true";  // replace
         pairs = Viv.getKeyValueDoubleOrNullsEx(codes, null);
         for (Viv.KeyValue<@Nullable Double> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: 1.0, b: null
         }
       
      Parameters:
      objects - object that may be a HashMap<String, @Nullable Double> value
      config - configuration if it is needed, null otherwise
      Returns:
      an array of key-value pairs as KeyValue<@Nullable Double>[]
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not HashMap<String, @Nullable Double>.
    • getKeyValueStrings

      public static Viv.KeyValue<String> @Nullable [] getKeyValueStrings(@Nullable Object... objects)
      Gets key-value pairs as an array. All values are expected as String. When other is given, null is returned.

      For example,

      
         // {"a": "alpha", "b": "beta"}
         String code = "{\"a\": \"alpha\", \"b\": \"beta\"}";
      
         // Evaluate directly.
         Viv.KeyValue<String>[] pairs = Viv.getKeyValueStrings(code);
         for (Viv.KeyValue<String> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: beta
         }
      
         // Evaluate result.
         Result result = Viv.run(code);
         pairs = Viv.getKeyValueStrings(result);
         for (Viv.KeyValue<String> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: beta
         }
      
         // Whole values are lost even if there is only one foreign object.
         code = "{\"a\": \"alpha\", \"b\": null}";  // replace
         pairs = Viv.getKeyValueStrings(code);
         System.out.println(pairs == null);  // true
      
         code = "{\"a\": \"alpha\", \"b\": 10}";  // replace
         pairs = Viv.getKeyValueStrings(code);
         System.out.println(pairs == null);  // true
       
      getKeyValueStringOrNulls(Object...) is suitable if you want not to lost whole values.
      Parameters:
      objects - object that may be a HashMap<String, String> value
      Returns:
      an array of key-value pairs as KeyValue<String>[]. null if evaluation is failed or the evaluated result is not HashMap<String, String>.
    • getKeyValueStrings

      public static Viv.KeyValue<String> @Nullable [] getKeyValueStrings(@Nullable Object[] objects, @Nullable Config config)
      Gets key-value pairs as an array. All values are expected as String. When other is given, null is returned.

      For example,

      
         // {"a": "alpha", "b": "beta"}
         String[] codes = {"\"a\": \"alpha\"", "\"b\": \"beta\""};
      
         // Evaluate directly.
         Viv.KeyValue<String>[] pairs = Viv.getKeyValueStrings(codes, null);
         for (Viv.KeyValue<String> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: beta
         }
      
         // Evaluate result.
         Result result = Viv.run(codes, null);
         pairs = Viv.getKeyValueStrings(result);
         for (Viv.KeyValue<String> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: beta
         }
      
         // Whole values are lost even if there is only one foreign object.
         codes[1] = "\"b\": null";  // replace
         pairs = Viv.getKeyValueStrings(codes, null);
         System.out.println(pairs == null);  // true
      
         codes[1] = "\"b\": 10";  // replace
         pairs = Viv.getKeyValueStrings(codes, null);
         System.out.println(pairs == null);  // true
       
      getKeyValueStringOrNulls(Object[], Config) is suitable if you want not to lost whole values.
      Parameters:
      objects - object that may be a HashMap<String, String> value
      config - configuration if it is needed, null otherwise
      Returns:
      an array of key-value pairs as KeyValue<String>[]. null if evaluation is failed or the evaluated result is not HashMap<String, String>.
    • getKeyValueStringsEx

      public static Viv.KeyValue<String>[] getKeyValueStringsEx(@Nullable Object... objects) throws VivException
      Gets key-value pairs as an array. (Permit exception) All values are expected as String. When other is given, exception is thrown.

      For example,

      
         // {"a": "alpha", "b": "beta"}
         String code = "{\"a\": \"alpha\", \"b\": \"beta\"}";
      
         // Evaluate directly.
         Viv.KeyValue<String>[] pairs = Viv.getKeyValueStringsEx(code);
         for (Viv.KeyValue<String> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: beta
         }
      
         // Evaluate result.
         Object object = Viv.runEx(code);
         pairs = Viv.getKeyValueStringsEx(object);
         for (Viv.KeyValue<String> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: beta
         }
      
         // Whole values are lost even if there is only one foreign object.
         code = "{\"a\": \"alpha\", \"b\": null}"; // replace
         pairs = Viv.getKeyValueStringsEx(code);  // Exception is thrown.
      
         code = "{\"a\": \"alpha\", \"b\": 10}"; // replace
         pairs = Viv.getKeyValueStringsEx(code);  // Exception is thrown.
       
      getKeyValueStringOrNullsEx(Object...) is suitable if you want not to lost whole values.
      Parameters:
      objects - object that may be a HashMap<String, String> value
      Returns:
      an array of key-value pairs as KeyValue<String>[]
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not HashMap<String, String>.
    • getKeyValueStringsEx

      public static Viv.KeyValue<String>[] getKeyValueStringsEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets key-value pairs as an array. (Permit exception) All values are expected as String. When other is given, exception is thrown.

      For example,

      
         // {"a": "alpha", "b": "beta"}
         String[] codes = {"\"a\": \"alpha\"", "\"b\": \"beta\""};
      
         // Evaluate directly.
         Viv.KeyValue<String>[] pairs = Viv.getKeyValueStringsEx(codes, null);
         for (Viv.KeyValue<String> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: beta
         }
      
         // Evaluate result.
         Object object = Viv.runEx(codes, null);
         pairs = Viv.getKeyValueStringsEx(object);
         for (Viv.KeyValue<String> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: beta
         }
      
         // Whole values are lost even if there is only one foreign object.
         codes[1] = "\"b\": null";  // replace
         pairs = Viv.getKeyValueStringsEx(codes, null);  // Exception is thrown.
      
         codes[1] = "\"b\": 10";  // replace
         pairs = Viv.getKeyValueStringsEx(codes, null);  // Exception is thrown.
       
      getKeyValueStringOrNullsEx(Object[], Config) is suitable if you want not to lost whole values.
      Parameters:
      objects - object that may be a HashMap<String, String> value
      config - configuration if it is needed, null otherwise
      Returns:
      an array of key-value pairs as KeyValue<String>[]
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not HashMap<String, String>.
    • getKeyValueStringOrNulls

      public static Viv.KeyValue<@Nullable String> @Nullable [] getKeyValueStringOrNulls(@Nullable Object... objects)
      Gets key-value pairs as an array. All values are expected as String. When other is given, it is replaced with null.

      For example,

      
         // {"a": "alpha", "b": null}
         String code = "{\"a\": \"alpha\", \"b\": null}";
      
         // Evaluate directly.
         Viv.KeyValue<@Nullable String>[] pairs =
                 Viv.getKeyValueStringOrNulls(code);
         for (Viv.KeyValue<@Nullable String> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: null
         }
      
         // Evaluate result.
         Result result = Viv.run(code);
         pairs = Viv.getKeyValueStringOrNulls(result);
         for (Viv.KeyValue<@Nullable String> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: null
         }
      
         // Evaluate another value directly.
         pairs = Viv.getKeyValueStringOrNulls("{\"a\": \"alpha\", \"b\": 10}");
         for (Viv.KeyValue<@Nullable String> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: null
         }
       
      Parameters:
      objects - object that may be a HashMap<String, @Nullable String> value
      Returns:
      an array of key-value pairs as KeyValue<@Nullable String>[]. null if evaluation is failed or the evaluated result is not HashMap<String, @Nullable String>.
    • getKeyValueStringOrNulls

      public static Viv.KeyValue<@Nullable String> @Nullable [] getKeyValueStringOrNulls(@Nullable Object[] objects, @Nullable Config config)
      Gets key-value pairs as an array. All values are expected as String. When other is given, it is replaced with null.

      For example,

      
         // {"a": "alpha", "b": null}
         String[] codes = {"\"a\": \"alpha\"", "\"b\": null"};
      
         // Evaluate directly.
         Viv.KeyValue<@Nullable String>[] pairs =
                 Viv.getKeyValueStringOrNulls(codes, null);
         for (Viv.KeyValue<@Nullable String> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: null
         }
      
         // Evaluate result.
         Result result = Viv.run(codes, null);
         pairs = Viv.getKeyValueStringOrNulls(result);
         for (Viv.KeyValue<@Nullable String> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: null
         }
      
         // Evaluate another value directly.
         codes[1] = "\"b\": 10";  // replace
         pairs = Viv.getKeyValueStringOrNulls(codes, null);
         for (Viv.KeyValue<@Nullable String> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: null
         }
       
      Parameters:
      objects - object that may be a HashMap<String, @Nullable String> value
      config - configuration if it is needed, null otherwise
      Returns:
      an array of key-value pairs as KeyValue<@Nullable String>[]. null if evaluation is failed or the evaluated result is not HashMap<String, @Nullable String>.
    • getKeyValueStringOrNullsEx

      public static Viv.KeyValue<@Nullable String>[] getKeyValueStringOrNullsEx(@Nullable Object... objects) throws VivException
      Gets key-value pairs as an array. (Permit exception) All values are expected as String. When other is given, it is replaced with null.

      For example,

      
         // {"a": "alpha", "b": null}
         String code = "{\"a\": \"alpha\", \"b\": null}";
      
         // Evaluate directly.
         Viv.KeyValue<@Nullable String>[] pairs =
                 Viv.getKeyValueStringOrNullsEx(code);
         for (Viv.KeyValue<@Nullable String> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: null
         }
      
         // Evaluate result.
         Object object = Viv.runEx(code);
         pairs = Viv.getKeyValueStringOrNullsEx(object);
         for (Viv.KeyValue<@Nullable String> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: null
         }
      
         // Evaluate another value directly.
         pairs = Viv.getKeyValueStringOrNullsEx("{\"a\": \"alpha\", \"b\": 10}");
         for (Viv.KeyValue<@Nullable String> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: null
         }
       
      Parameters:
      objects - object that may be a HashMap<String, @Nullable String> value
      Returns:
      an array of key-value pairs as KeyValue<@Nullable String>[]
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not HashMap<String, @Nullable String>.
    • getKeyValueStringOrNullsEx

      public static Viv.KeyValue<@Nullable String>[] getKeyValueStringOrNullsEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets key-value pairs as an array. (Permit exception) All values are expected as String. When other is given, it is replaced with null.

      For example,

      
         // {"a": "alpha", "b": null}
         String[] codes = {"\"a\": \"alpha\"", "\"b\": null"};
      
         // Evaluate directly.
         Viv.KeyValue<@Nullable String>[] pairs =
                 Viv.getKeyValueStringOrNullsEx(codes, null);
         for (Viv.KeyValue<@Nullable String> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: null
         }
      
         // Evaluate result.
         Object object = Viv.runEx(codes, null);
         pairs = Viv.getKeyValueStringOrNullsEx(object);
         for (Viv.KeyValue<@Nullable String> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: null
         }
      
         // Evaluate another value directly.
         codes[1] = "\"b\": 10";  // replace
         pairs = Viv.getKeyValueStringOrNullsEx(codes, null);
         for (Viv.KeyValue<@Nullable String> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: null
         }
       
      Parameters:
      objects - object that may be a HashMap<String, @Nullable String> value
      config - configuration if it is needed, null otherwise
      Returns:
      an array of key-value pairs as KeyValue<@Nullable String>[]
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not HashMap<String, @Nullable String>.
    • getKeyValueObjects

      public static Viv.KeyValue<Object> @Nullable [] getKeyValueObjects(@Nullable Object... objects)
      Gets key-value pairs as an array. All values are expected as Object. When there is null, null is returned as the whole returned value.

      For example,

      
         // {"a": "alpha", "b": 100}
         String code = "{\"a\": \"alpha\", \"b\": 100}";
      
         // Evaluate directly.
         Viv.KeyValue<Object>[] pairs = Viv.getKeyValueObjects(code);
         for (Viv.KeyValue<Object> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: 100
         }
      
         // Evaluate result.
         Result result = Viv.run(code);
         pairs = Viv.getKeyValueObjects(result);
         for (Viv.KeyValue<Object> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: 100
         }
      
         // Whole values are lost even if there is only one foreign object.
         code = "{\"a\": \"alpha\", \"b\": null}";  // replace
         pairs = Viv.getKeyValueObjects(code);
         System.out.println(pairs == null);  // true
       
      getKeyValueObjectOrNulls(Object...) is suitable if you want not to lost whole values.
      Parameters:
      objects - object that may be a HashMap<String, Object> value
      Returns:
      an array of key-value pairs as KeyValue<Object>[]. null if evaluation is failed or the evaluated result is not HashMap<String, Object>.
    • getKeyValueObjects

      public static Viv.KeyValue<Object> @Nullable [] getKeyValueObjects(@Nullable Object[] objects, @Nullable Config config)
      Gets key-value pairs as an array. All values are expected as Object. When there is null, null is returned as the whole returned value.

      For example,

      
         // {"a": "alpha", "b": 100}
         String[] codes = {"\"a\": \"alpha\"", "\"b\": 100"};
      
         // Evaluate directly.
         Viv.KeyValue<Object>[] pairs = Viv.getKeyValueObjects(codes, null);
         for (Viv.KeyValue<Object> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: 100
         }
      
         // Evaluate result.
         Result result = Viv.run(codes, null);
         pairs = Viv.getKeyValueObjects(result);
         for (Viv.KeyValue<Object> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: 100
         }
      
         // Whole values are lost even if there is only one foreign object.
         codes[1] = "\"b\": null";  // replace
         pairs = Viv.getKeyValueObjects(codes, null);
         System.out.println(pairs == null);  // true
       
      getKeyValueObjectOrNulls(Object[], Config) is suitable if you want not to lost whole values.
      Parameters:
      objects - object that may be a HashMap<String, Object> value
      config - configuration if it is needed, null otherwise
      Returns:
      an array of key-value pairs as KeyValue<Object>[]. null if evaluation is failed or the evaluated result is not HashMap<String, Object>.
    • getKeyValueObjectsEx

      public static Viv.KeyValue<Object>[] getKeyValueObjectsEx(@Nullable Object... objects) throws VivException
      Gets key-value pairs as an array. (Permit exception) All values are expected as Object. When there is null, exception is thrown.

      For example,

      
         // {"a": "alpha", "b": 100}
         String code = "{\"a\": \"alpha\", \"b\": 100}";
      
         // Evaluate directly.
         Viv.KeyValue<Object>[] pairs = Viv.getKeyValueObjectsEx(code);
         for (Viv.KeyValue<Object> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: 100
         }
      
         // Evaluate result.
         Result result = Viv.run(code);
         pairs = Viv.getKeyValueObjectsEx(result);
         for (Viv.KeyValue<Object> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: 100
         }
      
         // Whole values are lost even if there is only one foreign object.
         code = "{\"a\": \"alpha\", \"b\": null}";  // replace
         pairs = Viv.getKeyValueObjectsEx(code);  // Exception is thrown.
       
      getKeyValueObjectOrNullsEx(Object...) is suitable if you want not to lost whole values.
      Parameters:
      objects - object that may be a HashMap<String, Object> value
      Returns:
      an array of key-value pairs as KeyValue<Object>[]
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not HashMap<String, Object>.
    • getKeyValueObjectsEx

      public static Viv.KeyValue<Object>[] getKeyValueObjectsEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets key-value pairs as an array. (Permit exception) All values are expected as Object. When there is null, exception is thrown.

      For example,

      
         // {"a": "alpha", "b": 100}
         String[] codes = {"\"a\": \"alpha\"", "\"b\": 100"};
      
         // Evaluate directly.
         Viv.KeyValue<Object>[] pairs = Viv.getKeyValueObjectsEx(codes, null);
         for (Viv.KeyValue<Object> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: 100
         }
      
         // Evaluate result.
         Result result = Viv.run(codes, null);
         pairs = Viv.getKeyValueObjectsEx(result);
         for (Viv.KeyValue<Object> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: 100
         }
      
         // Whole values are lost even if there is only one foreign object.
         codes[1] = "\"b\": null";  // replace
         pairs = Viv.getKeyValueObjectsEx(codes, null);  // Exception is thrown.
       
      getKeyValueObjectOrNullsEx(Object[], Config) is suitable if you want not to lost whole values.
      Parameters:
      objects - object that may be a HashMap<String, Object> value
      config - configuration if it is needed, null otherwise
      Returns:
      an array of key-value pairs as KeyValue<Object>[]
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not HashMap<String, Object>.
    • getKeyValueObjectOrNulls

      public static Viv.KeyValue<@Nullable Object> @Nullable [] getKeyValueObjectOrNulls(@Nullable Object... objects)
      Gets key-value pairs as an array. All values are expected as Object. Even if there is null, it is permitted.

      For example,

      
         // {"a": "alpha", "b": null}
         String code = "{\"a\": \"alpha\", \"b\": null}";
      
         // Evaluate directly.
         Viv.KeyValue<@Nullable Object>[] pairs =
                 Viv.getKeyValueObjectOrNulls(code);
         for (Viv.KeyValue<@Nullable Object> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: null
         }
      
         // Evaluate result.
         Result result = Viv.run(code);
         pairs = Viv.getKeyValueObjectOrNulls(result);
         for (Viv.KeyValue<@Nullable Object> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: null
         }
       
      Parameters:
      objects - object that may be a HashMap<String, @Nullable Object> value
      Returns:
      an array of key-value pairs as KeyValue<@Nullable Object>[]. null if evaluation is failed or the evaluated result is not HashMap<String, @Nullable Object>.
    • getKeyValueObjectOrNulls

      public static Viv.KeyValue<@Nullable Object> @Nullable [] getKeyValueObjectOrNulls(@Nullable Object[] objects, @Nullable Config config)
      Gets key-value pairs as an array. All values are expected as Object. Even if there is null, it is permitted.

      For example,

      
         // {"a": "alpha", "b": null}
         String[] codes = {"\"a\": \"alpha\"", "\"b\": null"};
      
         // Evaluate directly.
         Viv.KeyValue<@Nullable Object>[] pairs =
                 Viv.getKeyValueObjectOrNulls(codes, null);
         for (Viv.KeyValue<@Nullable Object> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: null
         }
      
         // Evaluate result.
         Result result = Viv.run(codes, null);
         pairs = Viv.getKeyValueObjectOrNulls(result);
         for (Viv.KeyValue<@Nullable Object> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: null
         }
       
      Parameters:
      objects - object that may be a HashMap<String, @Nullable Object> value
      config - configuration if it is needed, null otherwise
      Returns:
      an array of key-value pairs as KeyValue<@Nullable Object>[]. null if evaluation is failed or the evaluated result is not HashMap<String, @Nullable Object>.
    • getKeyValueObjectOrNullsEx

      public static Viv.KeyValue<@Nullable Object>[] getKeyValueObjectOrNullsEx(@Nullable Object... objects) throws VivException
      Gets key-value pairs as an array. (Permit exception) All values are expected as Object. Even if there is null, it is permitted.

      For example,

      
         // {"a": "alpha", "b": null}
         String code = "{\"a\": \"alpha\", \"b\": null}";
      
         // Evaluate directly.
         Viv.KeyValue<@Nullable Object>[] pairs =
                 Viv.getKeyValueObjectOrNullsEx(code);
         for (Viv.KeyValue<@Nullable Object> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: null
         }
      
         // Evaluate result.
         Result result = Viv.run(code);
         pairs = Viv.getKeyValueObjectOrNullsEx(result);
         for (Viv.KeyValue<@Nullable Object> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: null
         }
       
      Parameters:
      objects - object that may be a HashMap<String, @Nullable Object> value
      Returns:
      an array of key-value pairs as KeyValue<@Nullable Object>[]
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not HashMap<String, @Nullable Object>.
    • getKeyValueObjectOrNullsEx

      public static Viv.KeyValue<@Nullable Object>[] getKeyValueObjectOrNullsEx(@Nullable Object[] objects, @Nullable Config config) throws VivException
      Gets key-value pairs as an array. (Permit exception) All values are expected as Object. Even if there is null, it is permitted.

      For example,

      
         // {"a": "alpha", "b": null}
         String[] codes = {"\"a\": \"alpha\"", "\"b\": null"};
      
         // Evaluate directly.
         Viv.KeyValue<@Nullable Object>[] pairs =
                 Viv.getKeyValueObjectOrNullsEx(codes, null);
         for (Viv.KeyValue<@Nullable Object> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: null
         }
      
         // Evaluate result.
         Result result = Viv.run(codes, null);
         pairs = Viv.getKeyValueObjectOrNullsEx(result);
         for (Viv.KeyValue<@Nullable Object> pair : pairs) {
           System.out.println(pair.key + ": " + pair.value);  // a: alpha, b: null
         }
       
      Parameters:
      objects - object that may be a HashMap<String, @Nullable Object> value
      config - configuration if it is needed, null otherwise
      Returns:
      an array of key-value pairs as KeyValue<@Nullable Object>[].
      Throws:
      VivException - it is thrown if evaluation is failed or the evaluated result is not HashMap<String, @Nullable Object>.
    • makeString

      public static String makeString(@Nullable Object value)
      Convert a value into string. Serialize a value into JSON string.
      Parameters:
      value - an object that may be Byte, Short, Integer, Long, Float, Double, Boolean, String, ArrayList<@Nullable Object>, HashMap<String, @Nullable Object>, or null
      Returns:
      a converted value
    • makeString

      public static String makeString(@Nullable Object value, @Nullable Config config)
      Converts a value into string. Serialize a value into JSON string.

      Configuration is available for Infinity and NaN (Not a Number). When it is not setting, "" (empty) is returned.

      Parameters:
      value - an object that may be Byte, Short, Integer, Long, Float, Double, Boolean, String, ArrayList<@Nullable Object>, HashMap<String, @Nullable Object>, or null
      config - configuration if needed, null otherwise
      Returns:
      a converted value