Class ReadBoxedJSON


  • public class ReadBoxedJSON
    extends java.lang.Object
    JSON Binding Helper-Class:
    JSON-Binding is the art of converting data that has been stored, saved or transmitted using Java-Script Object Notation into a Primitive-Type or Object-Type of any Programming Language, for instance Java. JSON often arrives into Java-Program Memory from an external Internet Connection, and may have traveled hundreds or even thousands of miles from a Host-Server.

    Unlike Java-Types which are checked by the Java-Compiler each-and-every time a programmer compiles his project, any guarantee that JSON-Type Data is pristine, uncorrupted, and in any kind of pre-agreed format is never completely assured.

    Being able to handle changes that might be made to an API (possibly from great distances away, and without the Software-Manager's consent) is the type of feature that robust JSON-Code simply has to offer.

    Binding-Helper Features:
    • Utilizes the Java-Standard javax.json.* Package-Library, & its Glass-Fish Implementation
    • Handles the Transfer & Conversion of All Json-Type's into Java-Type's with just One Line of Code
    • Provides all manner of User-Configurable Exception-Handling & Error-Decision Management via Class JFlag
    • Provides a Fine-Grained Suite of Exception-Classes, all with Consistent & Meaningful Error-Messages
    • Primary Helper-Classes for the (Experimental) Google-Chrome Headless Browser Package
    Builds on the J2EE Standard Release JSON Parsing Tools by providing additional help with converting JSON Data into Java Boxed-Primitive Types

    This class builds on the J2EE Standard 'Glass-Fish' JSON Processor

    There are several JSON Parsers available, and even more implementations for serializing and de-serializing data to/from JSON. The tool included in the J2EE is available on GitHub, and that is the one used by the Java HTML JAR Library. (See: javax.json.* )

    Primary Classes Used: JsonArray and JsonObject


    Note that this class simply doesn't support any methods for reading a java.lang.Character. This is because their are just entirely too many possibilities, combinations & options for the appropriate "Default Behavior" when attempting to read a single character of data from any random JSON Data-Type.

    Remember that the JSON Specification does not posses any "Single-JSON-Character" Data-Type. Creating some kind of Flag-Controlled Reader for a 'char' that can capably decide what to do would be so overtly verbose, for something so simple, that it isn't worth the effort...
    See Also:
    Json, JsonObject, JsonArray



    Stateless Class:
    This class neither contains any program-state, nor can it be instantiated. The @StaticFunctional Annotation may also be called 'The Spaghetti Report'. Static-Functional classes are, essentially, C-Styled Files, without any constructors or non-static member fields. It is a concept very similar to the Java-Bean's @Stateless Annotation.

    • 1 Constructor(s), 1 declared private, zero-argument constructor
    • 42 Method(s), 42 declared static
    • 0 Field(s)


    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class
      static class  ReadBoxedJSON.XL
    • Method Summary

       
      Integer: Retrieve a JsonNumber from a JsonArray, and transform it to a Java Boxed-Integer
      Modifier and Type Method
      static Integer getInteger​(JsonArray ja, int index)
      static Integer getInteger​(JsonArray ja, int index, int FLAGS, int defaultValue)
       
      Integer: Retrieve a JsonNumber from a JsonObject, and transform it to a Java Boxed-Integer
      Modifier and Type Method
      static Integer getInteger​(JsonObject jo, String propertyName, boolean isOptional)
      static Integer getInteger​(JsonObject jo, String propertyName, int FLAGS, int defaultValue)
       
      Integer: Retrieve a JsonString from a JsonArray or JsonObject, and parse it to a Boxed-Integer
      Modifier and Type Method
      static Integer parseInteger​(JsonArray ja, int index, int FLAGS, int defaultValue, Function<String,​Integer> optionalParser)
      static Integer parseInteger​(JsonObject jo, String propertyName, int FLAGS, int defaultValue, Function<String,​Integer> optionalParser)
       
      Long: Retrieve a JsonNumber from a JsonArray, and transform it to a Java Boxed-Long
      Modifier and Type Method
      static Long getLong​(JsonArray ja, int index)
      static Long getLong​(JsonArray ja, int index, int FLAGS, long defaultValue)
       
      Long: Retrieve a JsonNumber from a JsonObject, and transform it to a Java Boxed-Long
      Modifier and Type Method
      static Long getLong​(JsonObject jo, String propertyName, boolean isOptional)
      static Long getLong​(JsonObject jo, String propertyName, int FLAGS, long defaultValue)
       
      Long: Retrieve a JsonString from a JsonArray or JsonObject, and parse it to a Boxed-Long
      Modifier and Type Method
      static Long parseLong​(JsonArray ja, int index, int FLAGS, long defaultValue, Function<String,​Long> optionalParser)
      static Long parseLong​(JsonObject jo, String propertyName, int FLAGS, long defaultValue, Function<String,​Long> optionalParser)
       
      Short: Retrieve a JsonNumber from a JsonArray, and transform it to a Java Boxed-Short
      Modifier and Type Method
      static Short getShort​(JsonArray ja, int index)
      static Short getShort​(JsonArray ja, int index, int FLAGS, short defaultValue)
       
      Short: Retrieve a JsonNumber from a JsonObject, and transform it to a Java Boxed-Short
      Modifier and Type Method
      static Short getShort​(JsonObject jo, String propertyName, boolean isOptional)
      static Short getShort​(JsonObject jo, String propertyName, int FLAGS, short defaultValue)
       
      Short: Retrieve a JsonString from a JsonArray or JsonObject, and parse it to a Boxed-Short
      Modifier and Type Method
      static Short parseShort​(JsonArray ja, int index, int FLAGS, short defaultValue, Function<String,​Short> optionalParser)
      static Short parseShort​(JsonObject jo, String propertyName, int FLAGS, short defaultValue, Function<String,​Short> optionalParser)
       
      Byte: Retrieve a JsonNumber from a JsonArray, and transform it to a Java Boxed-Byte
      Modifier and Type Method
      static Byte getByte​(JsonArray ja, int index)
      static Byte getByte​(JsonArray ja, int index, int FLAGS, byte defaultValue)
       
      Byte: Retrieve a JsonNumber from a JsonObject, and transform it to a Java Boxed-Byte
      Modifier and Type Method
      static Byte getByte​(JsonObject jo, String propertyName, boolean isOptional)
      static Byte getByte​(JsonObject jo, String propertyName, int FLAGS, byte defaultValue)
       
      Byte: Retrieve a JsonString from a JsonArray or JsonObject, and parse it to a Boxed-Byte
      Modifier and Type Method
      static Byte parseByte​(JsonArray ja, int index, int FLAGS, byte defaultValue, Function<String,​Byte> optionalParser)
      static Byte parseByte​(JsonObject jo, String propertyName, int FLAGS, byte defaultValue, Function<String,​Byte> optionalParser)
       
      Double: Retrieve a JsonNumber from a JsonArray, and transform it to a Java Boxed-Double
      Modifier and Type Method
      static Double getDouble​(JsonArray ja, int index)
      static Double getDouble​(JsonArray ja, int index, int FLAGS, double defaultValue)
       
      Double: Retrieve a JsonNumber from a JsonObject, and transform it to a Java Boxed-Double
      Modifier and Type Method
      static Double getDouble​(JsonObject jo, String propertyName, boolean isOptional)
      static Double getDouble​(JsonObject jo, String propertyName, int FLAGS, double defaultValue)
       
      Double: Retrieve a JsonString from a JsonArray or JsonObject, and parse it to a Boxed-Double
      Modifier and Type Method
      static Double parseDouble​(JsonArray ja, int index, int FLAGS, double defaultValue, Function<String,​Double> optionalParser)
      static Double parseDouble​(JsonObject jo, String propertyName, int FLAGS, double defaultValue, Function<String,​Double> optionalParser)
       
      Float: Retrieve a JsonNumber from a JsonArray, and transform it to a Java Boxed-Float
      Modifier and Type Method
      static Float getFloat​(JsonArray ja, int index)
      static Float getFloat​(JsonArray ja, int index, int FLAGS, float defaultValue)
       
      Float: Retrieve a JsonNumber from a JsonObject, and transform it to a Java Boxed-Float
      Modifier and Type Method
      static Float getFloat​(JsonObject jo, String propertyName, boolean isOptional)
      static Float getFloat​(JsonObject jo, String propertyName, int FLAGS, float defaultValue)
       
      Float: Retrieve a JsonString from a JsonArray or JsonObject, and parse it to a Boxed-Float
      Modifier and Type Method
      static Float parseFloat​(JsonArray ja, int index, int FLAGS, float defaultValue, Function<String,​Float> optionalParser)
      static Float parseFloat​(JsonObject jo, String propertyName, int FLAGS, float defaultValue, Function<String,​Float> parser)
       
      Boolean: Retrieve JsonValue.TRUE or FALSE, from a JsonArray, and transform to Boxed-Boolean
      Modifier and Type Method
      static Boolean getBoolean​(JsonArray ja, int index)
      static Boolean getBoolean​(JsonArray ja, int index, int FLAGS, boolean defaultValue)
       
      Boolean: Retrieve JsonValue.TRUE or FALSE, from a JsonObject, and transform to Boxed-Boolean
      Modifier and Type Method
      static Boolean getBoolean​(JsonObject jo, String propertyName, boolean isOptional)
      static Boolean getBoolean​(JsonObject jo, String propertyName, int FLAGS, boolean defaultValue)
       
      Boolean: Retrieve a JsonString from a JsonArray or JsonObject, and parse to a Boxed-Boolean
      Modifier and Type Method
      static Boolean parseBoolean​(JsonArray ja, int index, int FLAGS, boolean defaultValue, Function<String,​Boolean> optionalParser)
      static Boolean parseBoolean​(JsonObject jo, String propertyName, int FLAGS, boolean defaultValue, Function<String,​Boolean> parser)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getInteger

        🡇     🗕  🗗  🗖
        public static java.lang.Integer getInteger​(JsonArray ja,
                                                   int index)
        Retrieve a JsonArray element, and transform it to a java.lang.Integer. If Json-Null is found - then Java-Null is returned.

        Boxed Java Null's:
        This method facilitates translating a Json-Null into a Java-Null since a Java Boxed-Type number is returned from this method, rather than a Java Primitive
        Parameters:
        ja - Any instance of JsonArray
        index - A valid index into array parameter 'ja'. In Json (and unlike Java), array element types are not actually checked for consistency - meaning an array may hold many different types! This array-index must contain a JsonNumber
        Returns:
        An instance of Java-Type java.lang.Integer, if and only if the array element located at 'index' uses the appropriate Json-Type - JsonNumber. If that array-index contains some other type, or that JsonNumber cannot be properly transformed to a java.lang.Integer, then an exception will throw.

        If the specified array-element inside 'ja' has been set to Json-Null, then Java-Null is returned.
        Throws:
        java.lang.IndexOutOfBoundsException - If 'index' is out of the bounds of 'ja'
        JsonTypeArrException - If the array-element (specified by 'index') does not actually contain a JsonNumber (but rather, some other non-null Json-Type), then this exception throws.
        JsonArithmeticArrException - Java's implementation of intValueExact() throws an ArithmeticException when that method cannot correctly transform / convert the element to a valid java.lang.Integer. The thrown-exception is then wrapped into this exception for the purpose of providing a much improved error-message, and convenience fields.
        See Also:
        RJInternal.GET(JsonArray, int, Function, Class), JsonNumber.intValueExact()
        Code:
        Exact Method Body:
         return GET(ja, index, JsonNumber::intValueExact, Integer.class);
        
      • getInteger

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Integer getInteger​(JsonArray ja,
                                                   int index,
                                                   int FLAGS,
                                                   int defaultValue)
        Retrieve a JsonArray element, and transform it to a java.lang.Integer. Please see the class documentation for JFlag for details about the error-handling flags provided by this method. Note that using the (lesser-known) Java-Syntax below, the flag-constants may be referenced without typing their full names at each use:

        // Note the use of the 'static' modifier here
        import static Torello.Java.Additional.JFlag.*;
        


        This method allows for many type-transformaton errors to be handled by converting the returned answer into either Java-Null, or a user-provided default-value (using the Flags). Additionally, if an ArithmeticException should throw, that exception-case can also be handled by using the default type-rounding mechanism java provides via method intValue() (without the 'Exact' word appended to the method-name). See the Java Documentation for BigDecimal.intValue() for an explanation about the behavior of flag RETURN_JAPPROX_ON_AEX and rounding a java.lang.Integer

        Auto Un-Boxing:
        Java's compile-time type-magic allows a user to assign this method's Boxed-Type return-value to its matching Primitive Type (It is called automatic boxing and unboxing).

        Just make sure to remember that if this method does return null because of erroneous JSON, and because the germaine Exception-Flags aren't set, your code would throw a NullPointerException! Compile Time Type Inferencing allows for:

        Example:
        // If null is actually returned, this would throw NullPointerException
        int val = ReadBoxedJSON.getInteger(jsonArray, 1, RETURN_NULL_ON_NULL, -1);
        
        // The following invocation gracefully returns a boxed '-1' if the array index is null,
        // or if the array index contains some non-integer number.
        // 
        // Note that Java's Type Inferencing auto-converts the boxed java.lang.Integer => 'int'
        // (auto-unboxes the returned reference to a int-primitive)
        
        int val = ReadBoxedJSON.getInteger
            (jsonArray, 1, RETURN_DEFVAL_ON_NULL | RETURN_DEFVAL_ON_AEX, -1);
        
        Parameters:
        ja - Any instance of JsonArray
        index - The array index containing the element to retrieve.
        FLAGS - Return-value / exception-throw constants defined in JFlag
        defaultValue - This is the 'Default Value' returned by this method, if there are any exception or problems converting or extracting the specified number.

        The default value is only returned by this method if the appropriate JSON Exception Flag has been passed to the 'FLAGS' parameter! Specifically, if 'FLAGS' were passed '0', then this parameter is fully-irrelevant and ignored. The exception flags are listed in inner-class JFlags

        AGAIN: If an exception-case is encountered, but the exception-flag for that exception has not been set, then this default-value won't be returned, and that exception will throw instead.
        Returns:
        If the JsonArray index contained a number, and that number was successfully transformed to a java.lang.Integer, then it is returned.

        If there were errors attempting to transform the array-element, but the user-provided flags have specified that the defaultValue be returned, then that is returned. Null is returned if the flags have specified a null-return on error.

        If flags has been passed a '0', and an error-case has arisen, then, instead, the relevant exception will throw.
        Throws:
        java.lang.IndexOutOfBoundsException - If 'index' is out of the bounds of input array 'ja' and none of these Exception-Flags are set:
        JsonArithmeticArrException - If the number converstion function throws an ArithmeticException while attempting to convert the JsonNumber into a java.lang.Integer, and none of these Exception-Flags are set:
        JsonNullArrException - If the JsonArray element located at 'index' contains Json-Null, rather than a JsonNumber, and none of these Exception-Flags are set:
        JsonTypeArrException - If the JsonArray element located at 'index' contains a some other Json-Type rather than JsonNumber, and none of these Exception-Flags are set:
        See Also:
        RJInternal.GET(JsonArray, int, int, Number, Class, Function, Function), JsonNumber.intValueExact(), JsonNumber.intValue()
        Code:
        Exact Method Body:
         return GET(
             ja, index, FLAGS, defaultValue,
             Integer.class, JsonNumber::intValueExact, JsonNumber::intValue
         );
        
      • parseInteger

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Integer parseInteger​
                    (JsonArray ja,
                     int index,
                     int FLAGS,
                     int defaultValue,
                     java.util.function.Function<java.lang.String,​java.lang.Integer> optionalParser)
        
        Retrieve a JsonArray element containing a JsonString, and transform it to a java.lang.Integer, with either a user-provided parser, or the standard java integer parser Please see the class documentation for JFlag for details about the error-handling flags provided by this method. Note that using the (lesser-known) Java-Syntax below, the flag-constants may be referenced without typing their full names at each use:

        // Note the use of the 'static' modifier here
        import static Torello.Java.Additional.JFlag.*;
        


        This method allows for many type-transformaton errors to be handled by converting the returned answer into either Java-Null, or a user-provided default-value, using the 'FLAGS' parameter.

        Auto Un-Boxing:
        Java's compile-time type-magic allows a user to assign this method's Boxed-Type return-value to its matching Primitive Type (It is called automatic boxing and unboxing).

        Just make sure to remember that if this method does return null because of erroneous JSON, and because the germaine Exception-Flags aren't set, your code would throw a NullPointerException! Compile Time Type Inferencing allows for:

        Example:
        // If null is actually returned, this would throw NullPointerException
        int val = ReadBoxedJSON.parseInteger(jsonArray, 1, RETURN_NULL_ON_NULL, -1, null);
        
        // The following invocation gracefully returns a boxed '-1' if the array index contains
        // an 'unparseable' String (or is null)
        // 
        // Note that Java's Type Inferencing auto-converts the boxed java.lang.Integer => 'int'
        // (auto-unboxes the returned reference to a int-primitive)
        
        int FLAGS = RETURN_DEFVAL_ON_NULL | RETURN_DEFVAL_ON_SPEX;
        int val = ReadBoxedJSON.parseInteger(jsonArray, 1, FLAGS, -1, null);
        
        Parameters:
        ja - Any instance of JsonArray
        index - The array index containing the JsonString element to retrieve.
        FLAGS - Return-value / exception-throw constants defined in JFlag
        defaultValue - This is the 'Default Value' returned by this method, if there are any exception or problems converting or extracting the specified number.

        The default value is only returned by this method if the appropriate JSON Exception Flag has been passed to the 'FLAGS' parameter! Specifically, if 'FLAGS' were passed '0', then this parameter is fully-irrelevant and ignored. The exception flags are listed in inner-class JFlags

        AGAIN: If an exception-case is encountered, but the exception-flag for that exception has not been set, then this default-value won't be returned, and that exception will throw instead.
        optionalParser - Any function-pointer to a function that will transform / convert a java.lang.String into a java.lang.Integer.

        NOTE: This parameter may be null, and if it is, the standard Java invocation of Integer.parseInt(String.trim()) is used.
        Returns:
        If the JsonArray index contained a JsonString, and that string was successfully parsed to a java.lang.Integer, then it is returned.
        If there were errors attempting to transform the String array-element, and the user-provided flags specified that defaultValue be returned, then that is returned. Null is returned if the flags specified it on error.

        If flags has been passed a '0', and an error-case has arisen, then the relevant exception will throw, instead.
        Throws:
        java.lang.IndexOutOfBoundsException - If 'index' is out of the bounds of input array 'ja' and none of these Exception-Flags are set:
        JsonArithmeticArrException - If the number converstion function throws an ArithmeticException while attempting to convert the JsonString into a java.lang.Integer, and none of these Exception-Flags are set:
        JsonStrParseArrException - If the JsonArray element located at 'index' throws an exception while attempting to parse the java.lang.String into a java.lang.Integer, and none of these Exception-Flags are set:
        JsonNullArrException - If the JsonArray element located at 'index' contains Json-Null, rather than a JsonString, and none of these Exception-Flags are set:
        JsonTypeArrException - If the JsonArray element located at 'index' contains a some other Json-Type rather than JsonString, and none of these Exception-Flags are set:
        See Also:
        RJInternal.PARSE(JsonObject, String, int, Number, Class, Function, Function, Function)
        Code:
        Exact Method Body:
         return PARSE(
             ja, index, FLAGS, defaultValue, Integer.class, optionalParser,
             BigDecimal::intValueExact, BigDecimal::intValue
         );
        
      • getInteger

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Integer getInteger​(JsonObject jo,
                                                   java.lang.String propertyName,
                                                   boolean isOptional)
        Extract a JsonObject property, and transform it to a java.lang.Integer. If Json-Null is found - then Java-Null is returned.

        Boxed Java Null's:
        This method facilitates translating a Json-Null into a Java-Null since a Java Boxed-Type number is returned from this method, rather than a Java Primitive
        Parameters:
        jo - Any instance of JsonObject.
        propertyName - The name of the JSON property that should be contained within 'jo'. This property will be retrieved and subsequently transformed / converted to Java-Type java.lang.Integer.
        isOptional - When TRUE is passed, if 'propertyName' is not actually listed in 'jo' this method shall return Java-Null gracefully. When FALSE is passed, if 'jo' does not have the specified property, a JsonPropMissingException will throw.

        If 'jo' actually has a property named 'propertyName', then the value passed to this parameter is fully irrelevant.
        Returns:
        An instance of Java-Type java.lang.Integer, if and only if the 'propertyName' is available inside 'jo', and that property uses the appropriate Json-Type - JsonNumber

        If the specified property has been set to 'null' (Json-Null) in the passed JsonObject, then Java-Null is returned. Java-Null is also returned if 'propertyName' is not listed / unavailable in 'jo' and TRUE has been passed to 'isOptional'.

        Other cases shall generate an exception throw.
        Throws:
        JsonPropMissingException - This exception shall throw if the specified property is missing from the 'JsonObject' (parameter 'jo'). This exception throw can be avoided if 'TRUE' is passed to parameter 'isOptional'.
        JsonArithmeticObjException - Java's implementation of intValueExact() throws an ArithmeticException when that method cannot correctly transform / convert the element to a valid java.lang.Integer. The thrown-exception is then wrapped into this exception for the purpose of providing a much improved error-message, and convenience fields.
        JsonTypeObjException - If the property (specified by 'propertyName') is extracted, but that property does not actually contain a JsonNumber (but rather, some other non-null Json-Type), then this exception throws.
        See Also:
        RJInternal.GET(JsonObject, String, boolean, Function, Class), JsonNumber.intValueExact()
        Code:
        Exact Method Body:
         return GET(jo, propertyName, isOptional, JsonNumber::intValueExact, Integer.class);
        
      • getInteger

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Integer getInteger​(JsonObject jo,
                                                   java.lang.String propertyName,
                                                   int FLAGS,
                                                   int defaultValue)
        Retrieve a JsonObject property, and transform it to a java.lang.Integer. Please see the class documentation for JFlag for details about the error-handling flags provided by this method. Note that using the (lesser-known) Java-Syntax below, the flag-constants may be referenced without typing their full names at each use:

        // Note the use of the 'static' modifier here
        import static Torello.Java.Additional.JFlag.*;
        


        This method allows for many type-transformaton errors to be handled by converting the returned answer into either Java-Null, or a user-provided default-value (using the Flags). Additionally, if an ArithmeticException should throw, that exception-case can also be handled by using the default type-rounding mechanism java provides via method intValue() (without the 'Exact' word appended to the method-name). See the Java Documentation for BigDecimal.intValue() for an explanation about the behavior of flag RETURN_JAPPROX_ON_AEX and rounding a java.lang.Integer

        Auto Un-Boxing:
        Java's compile-time type-magic allows a user to assign this method's Boxed-Type return-value to its matching Primitive Type (It is called automatic boxing and unboxing).

        Just make sure to remember that if this method does return null because of erroneous JSON, and because the germaine Exception-Flags aren't set, your code would throw a NullPointerException! Compile Time Type Inferencing allows for:

        Example:
        // If null is actually returned, this would throw NullPointerException
        int val = ReadBoxedJSON.getInteger(jsonObj, "myProp", RETURN_NULL_ON_NULL -1);
        
        // The following invocation gracefully returns a boxed '-1' if the property contains a
        // null, or if the property holds some non-integer number.
        // 
        // Note that Java's Type Inferencing auto-converts the boxed java.lang.Integer => 'int'
        // (auto-unboxes the returned reference to a int-primitive)
        
        int val = ReadBoxedJSON.getInteger
            (jsonObj, "myProp", RETURN_DEFVAL_ON_NULL & RETURN_DEFVAL_ON_AEX, -1);
        
        Parameters:
        jo - Any instance of JsonObject
        propertyName - The name of the JSON property that should be contained within 'jo'. This property will be retrieved and subsequently transformed / converted to Java-Type java.lang.Integer.
        FLAGS - Return-value / exception-throw constants defined in JFlag
        defaultValue - This is the 'Default Value' returned by this method, if there are any exception or problems converting or extracting the specified number.

        The default value is only returned by this method if the appropriate JSON Exception Flag has been passed to the 'FLAGS' parameter! Specifically, if 'FLAGS' were passed '0', then this parameter is fully-irrelevant and ignored. The exception flags are listed in inner-class JFlags

        AGAIN: If an exception-case is encountered, but the exception-flag for that exception has not been set, then this default-value won't be returned, and that exception will throw instead.
        Returns:
        If the JsonObject property contained a number, and that number was successfully transformed to a java.lang.Integer, then it is returned.

        If there were errors attempting to transform the object-property, and the user-provided flags have specified that the defaultValue be returned, then that is returned. Null is returned if the flags have specified a null-return on error.

        If flags has been passed a '0', and an error-case has arisen, then, instead, the relevant exception will throw.
        Throws:
        JsonPropMissingException - If 'jo' does not have a property with the name 'propertyName' and none of these Exception-Flags are set:
        JsonArithmeticObjException - If the number converstion function throws an ArithmeticException while attempting to convert the JsonNumber into a java.lang.Integer, and none of these Exception-Flags are set:
        JsonNullObjException - If the JsonObject property specified by 'propertyName' contains Json-Null, rather than a JsonNumber, and none of these Exception-Flags are set:
        JsonTypeObjException - If the JsonObject property specified by 'propertyName' contains a some other Json-Type rather than JsonNumber, and none of these Exception-Flags are set:
        See Also:
        RJInternal.GET(JsonObject, String, int, Number, Class, Function, Function), JsonNumber.intValueExact(), JsonNumber.intValue()
        Code:
        Exact Method Body:
         return GET(
             jo, propertyName, FLAGS, defaultValue,
             Integer.class, JsonNumber::intValueExact, JsonNumber::intValue
         );
        
      • parseInteger

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Integer parseInteger​
                    (JsonObject jo,
                     java.lang.String propertyName,
                     int FLAGS,
                     int defaultValue,
                     java.util.function.Function<java.lang.String,​java.lang.Integer> optionalParser)
        
        Retrieve a JsonObject property containing a JsonString, and transform it to a java.lang.Integer, with either a user-provided parser, or the standard java integer parser Please see the class documentation for JFlag for details about the error-handling flags provided by this method. Note that using the (lesser-known) Java-Syntax below, the flag-constants may be referenced without typing their full names at each use:

        // Note the use of the 'static' modifier here
        import static Torello.Java.Additional.JFlag.*;
        


        This method allows for many type-transformaton errors to be handled by converting the returned answer into either Java-Null, or a user-provided default-value, using the 'FLAGS' parameter.

        Auto Un-Boxing:
        Java's compile-time type-magic allows a user to assign this method's Boxed-Type return-value to its matching Primitive Type (It is called automatic boxing and unboxing).

        Just make sure to remember that if this method does return null because of erroneous JSON, and because the germaine Exception-Flags aren't set, your code would throw a NullPointerException! Compile Time Type Inferencing allows for:

        Example:
        // If null is actually returned, this would throw NullPointerException
        int val = ReadBoxedJSON.parseInteger(jsonObj, "myProp", RETURN_NULL_ON_NULL, -1);
        
        // The following invocation gracefully returns a boxed '-1' if the property contains an
        // 'unparseable' String, or if it is null.
        // 
        // Note that Java's Type Inferencing auto-converts the boxed java.lang.Integer => 'int'
        // (auto-unboxes the returned reference to a int-primitive)
        
        int FLAGS = RETURN_DEFVAL_ON_NULL | RETURN_DEFVAL_ON_SPEX
        int val = ReadBoxedJSON.parseInteger(jsonObj, "myProp", FLAGS , -1);
        
        Parameters:
        jo - Any instance of JsonObject
        propertyName - The name of the JSON property that should be contained within 'jo'. This property will be retrieved and subsequently transformed / converted to Java-Type java.lang.Integer.
        FLAGS - Return-value / exception-throw constants defined in JFlag
        defaultValue - This is the 'Default Value' returned by this method, if there are any exception or problems converting or extracting the specified number.

        The default value is only returned by this method if the appropriate JSON Exception Flag has been passed to the 'FLAGS' parameter! Specifically, if 'FLAGS' were passed '0', then this parameter is fully-irrelevant and ignored. The exception flags are listed in inner-class JFlags

        AGAIN: If an exception-case is encountered, but the exception-flag for that exception has not been set, then this default-value won't be returned, and that exception will throw instead.
        optionalParser - Any function-pointer to a function that will transform / convert a java.lang.String into a java.lang.Integer.

        NOTE: This parameter may be null, and if it is, the standard Java invocation of Integer.parseInt(String.trim()) is used.
        Returns:
        If the JsonObject property contained a JsonString, and that string was successfully parsed to a java.lang.Integer, then it is returned.
        If there were errors attempting to transform the String object-property, and the user-provided flags specified that defaultValue be returned, then that is returned. Null is returned if the flags specified it on error.

        If flags has been passed a '0', and an error-case has arisen, then the relevant exception will throw, instead.
        Throws:
        JsonPropMissingException - If 'jo' does not have a property with the name 'propertyName' and none of these Exception-Flags are set:
        JsonArithmeticObjException - If the number converstion function throws an ArithmeticException while attempting to convert the JsonString into a java.lang.Integer, and none of these Exception-Flags are set:
        JsonStrParseObjException - If the JsonObject property specified by 'propertyName' throws an exception while attempting to parse the java.lang.String into a java.lang.Integer, and none of these Exception-Flags are set:
        JsonNullObjException - If the JsonObject property specified by 'propertyName' contains Json-Null, rather than a JsonString, and none of these Exception-Flags are set:
        JsonTypeObjException - If the JsonObject property specified by 'propertyName' contains a some other Json-Type rather than JsonString, and none of these Exception-Flags are set:
        See Also:
        RJInternal.PARSE(JsonObject, String, int, Number, Class, Function, Function, Function)
        Code:
        Exact Method Body:
         return PARSE(
             jo, propertyName, FLAGS, defaultValue, Integer.class, optionalParser,
             BigDecimal::intValueExact, BigDecimal::intValue
         );
        
      • getLong

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Long getLong​(JsonArray ja,
                                             int index)
        Retrieve a JsonArray element, and transform it to a java.lang.Long. If Json-Null is found - then Java-Null is returned.

        Boxed Java Null's:
        This method facilitates translating a Json-Null into a Java-Null since a Java Boxed-Type number is returned from this method, rather than a Java Primitive
        Parameters:
        ja - Any instance of JsonArray
        index - A valid index into array parameter 'ja'. In Json (and unlike Java), array element types are not actually checked for consistency - meaning an array may hold many different types! This array-index must contain a JsonNumber
        Returns:
        An instance of Java-Type java.lang.Long, if and only if the array element located at 'index' uses the appropriate Json-Type - JsonNumber. If that array-index contains some other type, or that JsonNumber cannot be properly transformed to a java.lang.Long, then an exception will throw.

        If the specified array-element inside 'ja' has been set to Json-Null, then Java-Null is returned.
        Throws:
        java.lang.IndexOutOfBoundsException - If 'index' is out of the bounds of 'ja'
        JsonTypeArrException - If the array-element (specified by 'index') does not actually contain a JsonNumber (but rather, some other non-null Json-Type), then this exception throws.
        JsonArithmeticArrException - Java's implementation of longValueExact() throws an ArithmeticException when that method cannot correctly transform / convert the element to a valid java.lang.Long. The thrown-exception is then wrapped into this exception for the purpose of providing a much improved error-message, and convenience fields.
        See Also:
        RJInternal.GET(JsonArray, int, Function, Class), JsonNumber.longValueExact()
        Code:
        Exact Method Body:
         return GET(ja, index, JsonNumber::longValueExact, Long.class);
        
      • getLong

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Long getLong​(JsonArray ja,
                                             int index,
                                             int FLAGS,
                                             long defaultValue)
        Retrieve a JsonArray element, and transform it to a java.lang.Long. Please see the class documentation for JFlag for details about the error-handling flags provided by this method. Note that using the (lesser-known) Java-Syntax below, the flag-constants may be referenced without typing their full names at each use:

        // Note the use of the 'static' modifier here
        import static Torello.Java.Additional.JFlag.*;
        


        This method allows for many type-transformaton errors to be handled by converting the returned answer into either Java-Null, or a user-provided default-value (using the Flags). Additionally, if an ArithmeticException should throw, that exception-case can also be handled by using the default type-rounding mechanism java provides via method longValue() (without the 'Exact' word appended to the method-name). See the Java Documentation for BigDecimal.longValue() for an explanation about the behavior of flag RETURN_JAPPROX_ON_AEX and rounding a java.lang.Long

        Auto Un-Boxing:
        Java's compile-time type-magic allows a user to assign this method's Boxed-Type return-value to its matching Primitive Type (It is called automatic boxing and unboxing).

        Just make sure to remember that if this method does return null because of erroneous JSON, and because the germaine Exception-Flags aren't set, your code would throw a NullPointerException! Compile Time Type Inferencing allows for:

        Example:
        // If null is actually returned, this would throw NullPointerException
        long val = ReadBoxedJSON.getLong(jsonArray, 1, RETURN_NULL_ON_NULL, -1);
        
        // The following invocation gracefully returns a boxed '-1' if the array index is null,
        // or if the array index contains some non-integer number.
        // 
        // Note that Java's Type Inferencing auto-converts the boxed java.lang.Long => 'long'
        // (auto-unboxes the returned reference to a long-primitive)
        
        long val = ReadBoxedJSON.getLong
            (jsonArray, 1, RETURN_DEFVAL_ON_NULL | RETURN_DEFVAL_ON_AEX, -1);
        
        Parameters:
        ja - Any instance of JsonArray
        index - The array index containing the element to retrieve.
        FLAGS - Return-value / exception-throw constants defined in JFlag
        defaultValue - This is the 'Default Value' returned by this method, if there are any exception or problems converting or extracting the specified number.

        The default value is only returned by this method if the appropriate JSON Exception Flag has been passed to the 'FLAGS' parameter! Specifically, if 'FLAGS' were passed '0', then this parameter is fully-irrelevant and ignored. The exception flags are listed in inner-class JFlags

        AGAIN: If an exception-case is encountered, but the exception-flag for that exception has not been set, then this default-value won't be returned, and that exception will throw instead.
        Returns:
        If the JsonArray index contained a number, and that number was successfully transformed to a java.lang.Long, then it is returned.

        If there were errors attempting to transform the array-element, but the user-provided flags have specified that the defaultValue be returned, then that is returned. Null is returned if the flags have specified a null-return on error.

        If flags has been passed a '0', and an error-case has arisen, then, instead, the relevant exception will throw.
        Throws:
        java.lang.IndexOutOfBoundsException - If 'index' is out of the bounds of input array 'ja' and none of these Exception-Flags are set:
        JsonArithmeticArrException - If the number converstion function throws an ArithmeticException while attempting to convert the JsonNumber into a java.lang.Long, and none of these Exception-Flags are set:
        JsonNullArrException - If the JsonArray element located at 'index' contains Json-Null, rather than a JsonNumber, and none of these Exception-Flags are set:
        JsonTypeArrException - If the JsonArray element located at 'index' contains a some other Json-Type rather than JsonNumber, and none of these Exception-Flags are set:
        See Also:
        RJInternal.GET(JsonArray, int, int, Number, Class, Function, Function), JsonNumber.longValueExact(), JsonNumber.longValue()
        Code:
        Exact Method Body:
         return GET(
             ja, index, FLAGS, defaultValue,
             Long.class, JsonNumber::longValueExact, JsonNumber::longValue
         );
        
      • parseLong

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Long parseLong​
                    (JsonArray ja,
                     int index,
                     int FLAGS,
                     long defaultValue,
                     java.util.function.Function<java.lang.String,​java.lang.Long> optionalParser)
        
        Retrieve a JsonArray element containing a JsonString, and transform it to a java.lang.Long, with either a user-provided parser, or the standard java long-integer parser Please see the class documentation for JFlag for details about the error-handling flags provided by this method. Note that using the (lesser-known) Java-Syntax below, the flag-constants may be referenced without typing their full names at each use:

        // Note the use of the 'static' modifier here
        import static Torello.Java.Additional.JFlag.*;
        


        This method allows for many type-transformaton errors to be handled by converting the returned answer into either Java-Null, or a user-provided default-value, using the 'FLAGS' parameter.

        Auto Un-Boxing:
        Java's compile-time type-magic allows a user to assign this method's Boxed-Type return-value to its matching Primitive Type (It is called automatic boxing and unboxing).

        Just make sure to remember that if this method does return null because of erroneous JSON, and because the germaine Exception-Flags aren't set, your code would throw a NullPointerException! Compile Time Type Inferencing allows for:

        Example:
        // If null is actually returned, this would throw NullPointerException
        long val = ReadBoxedJSON.parseLong(jsonArray, 1, RETURN_NULL_ON_NULL, -1, null);
        
        // The following invocation gracefully returns a boxed '-1' if the array index contains
        // an 'unparseable' String (or is null)
        // 
        // Note that Java's Type Inferencing auto-converts the boxed java.lang.Long => 'long'
        // (auto-unboxes the returned reference to a long-primitive)
        
        int FLAGS = RETURN_DEFVAL_ON_NULL | RETURN_DEFVAL_ON_SPEX;
        long val = ReadBoxedJSON.parseLong(jsonArray, 1, FLAGS, -1, null);
        
        Parameters:
        ja - Any instance of JsonArray
        index - The array index containing the JsonString element to retrieve.
        FLAGS - Return-value / exception-throw constants defined in JFlag
        defaultValue - This is the 'Default Value' returned by this method, if there are any exception or problems converting or extracting the specified number.

        The default value is only returned by this method if the appropriate JSON Exception Flag has been passed to the 'FLAGS' parameter! Specifically, if 'FLAGS' were passed '0', then this parameter is fully-irrelevant and ignored. The exception flags are listed in inner-class JFlags

        AGAIN: If an exception-case is encountered, but the exception-flag for that exception has not been set, then this default-value won't be returned, and that exception will throw instead.
        optionalParser - Any function-pointer to a function that will transform / convert a java.lang.String into a java.lang.Long.

        NOTE: This parameter may be null, and if it is, the standard Java invocation of Long.parseLong(String.trim()) is used.
        Returns:
        If the JsonArray index contained a JsonString, and that string was successfully parsed to a java.lang.Long, then it is returned.
        If there were errors attempting to transform the String array-element, and the user-provided flags specified that defaultValue be returned, then that is returned. Null is returned if the flags specified it on error.

        If flags has been passed a '0', and an error-case has arisen, then the relevant exception will throw, instead.
        Throws:
        java.lang.IndexOutOfBoundsException - If 'index' is out of the bounds of input array 'ja' and none of these Exception-Flags are set:
        JsonArithmeticArrException - If the number converstion function throws an ArithmeticException while attempting to convert the JsonString into a java.lang.Long, and none of these Exception-Flags are set:
        JsonStrParseArrException - If the JsonArray element located at 'index' throws an exception while attempting to parse the java.lang.String into a java.lang.Long, and none of these Exception-Flags are set:
        JsonNullArrException - If the JsonArray element located at 'index' contains Json-Null, rather than a JsonString, and none of these Exception-Flags are set:
        JsonTypeArrException - If the JsonArray element located at 'index' contains a some other Json-Type rather than JsonString, and none of these Exception-Flags are set:
        See Also:
        RJInternal.PARSE(JsonObject, String, int, Number, Class, Function, Function, Function)
        Code:
        Exact Method Body:
         return PARSE(
             ja, index, FLAGS, defaultValue, Long.class, optionalParser,
             BigDecimal::longValueExact, BigDecimal::longValue
         );
        
      • getLong

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Long getLong​(JsonObject jo,
                                             java.lang.String propertyName,
                                             boolean isOptional)
        Extract a JsonObject property, and transform it to a java.lang.Long. If Json-Null is found - then Java-Null is returned.

        Boxed Java Null's:
        This method facilitates translating a Json-Null into a Java-Null since a Java Boxed-Type number is returned from this method, rather than a Java Primitive
        Parameters:
        jo - Any instance of JsonObject.
        propertyName - The name of the JSON property that should be contained within 'jo'. This property will be retrieved and subsequently transformed / converted to Java-Type java.lang.Long.
        isOptional - When TRUE is passed, if 'propertyName' is not actually listed in 'jo' this method shall return Java-Null gracefully. When FALSE is passed, if 'jo' does not have the specified property, a JsonPropMissingException will throw.

        If 'jo' actually has a property named 'propertyName', then the value passed to this parameter is fully irrelevant.
        Returns:
        An instance of Java-Type java.lang.Long, if and only if the 'propertyName' is available inside 'jo', and that property uses the appropriate Json-Type - JsonNumber

        If the specified property has been set to 'null' (Json-Null) in the passed JsonObject, then Java-Null is returned. Java-Null is also returned if 'propertyName' is not listed / unavailable in 'jo' and TRUE has been passed to 'isOptional'.

        Other cases shall generate an exception throw.
        Throws:
        JsonPropMissingException - This exception shall throw if the specified property is missing from the 'JsonObject' (parameter 'jo'). This exception throw can be avoided if 'TRUE' is passed to parameter 'isOptional'.
        JsonArithmeticObjException - Java's implementation of longValueExact() throws an ArithmeticException when that method cannot correctly transform / convert the element to a valid java.lang.Long. The thrown-exception is then wrapped into this exception for the purpose of providing a much improved error-message, and convenience fields.
        JsonTypeObjException - If the property (specified by 'propertyName') is extracted, but that property does not actually contain a JsonNumber (but rather, some other non-null Json-Type), then this exception throws.
        See Also:
        RJInternal.GET(JsonObject, String, boolean, Function, Class), JsonNumber.longValueExact()
        Code:
        Exact Method Body:
         return GET(jo, propertyName, isOptional, JsonNumber::longValueExact, Long.class);
        
      • getLong

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Long getLong​(JsonObject jo,
                                             java.lang.String propertyName,
                                             int FLAGS,
                                             long defaultValue)
        Retrieve a JsonObject property, and transform it to a java.lang.Long. Please see the class documentation for JFlag for details about the error-handling flags provided by this method. Note that using the (lesser-known) Java-Syntax below, the flag-constants may be referenced without typing their full names at each use:

        // Note the use of the 'static' modifier here
        import static Torello.Java.Additional.JFlag.*;
        


        This method allows for many type-transformaton errors to be handled by converting the returned answer into either Java-Null, or a user-provided default-value (using the Flags). Additionally, if an ArithmeticException should throw, that exception-case can also be handled by using the default type-rounding mechanism java provides via method intValue() (without the 'Exact' word appended to the method-name). See the Java Documentation for BigDecimal.intValue() for an explanation about the behavior of flag RETURN_JAPPROX_ON_AEX and rounding a java.lang.Long

        Auto Un-Boxing:
        Java's compile-time type-magic allows a user to assign this method's Boxed-Type return-value to its matching Primitive Type (It is called automatic boxing and unboxing).

        Just make sure to remember that if this method does return null because of erroneous JSON, and because the germaine Exception-Flags aren't set, your code would throw a NullPointerException! Compile Time Type Inferencing allows for:

        Example:
        // If null is actually returned, this would throw NullPointerException
        int val = ReadBoxedJSON.getLong(jsonObj, "myProp", RETURN_NULL_ON_NULL -1);
        
        // The following invocation gracefully returns a boxed '-1' if the property contains a
        // null, or if the property holds some non-integer number.
        // 
        // Note that Java's Type Inferencing auto-converts the boxed java.lang.Long => 'int'
        // (auto-unboxes the returned reference to a int-primitive)
        
        int val = ReadBoxedJSON.getLong
            (jsonObj, "myProp", RETURN_DEFVAL_ON_NULL & RETURN_DEFVAL_ON_AEX, -1);
        
        Parameters:
        jo - Any instance of JsonObject
        propertyName - The name of the JSON property that should be contained within 'jo'. This property will be retrieved and subsequently transformed / converted to Java-Type java.lang.Long.
        FLAGS - Return-value / exception-throw constants defined in JFlag
        defaultValue - This is the 'Default Value' returned by this method, if there are any exception or problems converting or extracting the specified number.

        The default value is only returned by this method if the appropriate JSON Exception Flag has been passed to the 'FLAGS' parameter! Specifically, if 'FLAGS' were passed '0', then this parameter is fully-irrelevant and ignored. The exception flags are listed in inner-class JFlags

        AGAIN: If an exception-case is encountered, but the exception-flag for that exception has not been set, then this default-value won't be returned, and that exception will throw instead.
        Returns:
        If the JsonObject property contained a number, and that number was successfully transformed to a java.lang.Long, then it is returned.

        If there were errors attempting to transform the object-property, and the user-provided flags have specified that the defaultValue be returned, then that is returned. Null is returned if the flags have specified a null-return on error.

        If flags has been passed a '0', and an error-case has arisen, then, instead, the relevant exception will throw.
        Throws:
        JsonPropMissingException - If 'jo' does not have a property with the name 'propertyName' and none of these Exception-Flags are set:
        JsonArithmeticObjException - If the number converstion function throws an ArithmeticException while attempting to convert the JsonNumber into a java.lang.Long, and none of these Exception-Flags are set:
        JsonNullObjException - If the JsonObject property specified by 'propertyName' contains Json-Null, rather than a JsonNumber, and none of these Exception-Flags are set:
        JsonTypeObjException - If the JsonObject property specified by 'propertyName' contains a some other Json-Type rather than JsonNumber, and none of these Exception-Flags are set:
        See Also:
        RJInternal.GET(JsonObject, String, int, Number, Class, Function, Function), JsonNumber.longValueExact(), JsonNumber.longValue()
        Code:
        Exact Method Body:
         return GET(
             jo, propertyName, FLAGS, defaultValue,
             Long.class, JsonNumber::longValueExact, JsonNumber::longValue
         );
        
      • parseLong

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Long parseLong​
                    (JsonObject jo,
                     java.lang.String propertyName,
                     int FLAGS,
                     long defaultValue,
                     java.util.function.Function<java.lang.String,​java.lang.Long> optionalParser)
        
        Retrieve a JsonObject property containing a JsonString, and transform it to a java.lang.Long, with either a user-provided parser, or the standard java long-integer parser Please see the class documentation for JFlag for details about the error-handling flags provided by this method. Note that using the (lesser-known) Java-Syntax below, the flag-constants may be referenced without typing their full names at each use:

        // Note the use of the 'static' modifier here
        import static Torello.Java.Additional.JFlag.*;
        


        This method allows for many type-transformaton errors to be handled by converting the returned answer into either Java-Null, or a user-provided default-value, using the 'FLAGS' parameter.

        Auto Un-Boxing:
        Java's compile-time type-magic allows a user to assign this method's Boxed-Type return-value to its matching Primitive Type (It is called automatic boxing and unboxing).

        Just make sure to remember that if this method does return null because of erroneous JSON, and because the germaine Exception-Flags aren't set, your code would throw a NullPointerException! Compile Time Type Inferencing allows for:

        Example:
        // If null is actually returned, this would throw NullPointerException
        long val = ReadBoxedJSON.parseLong(jsonObj, "myProp", RETURN_NULL_ON_NULL, -1);
        
        // The following invocation gracefully returns a boxed '-1' if the property contains an
        // 'unparseable' String, or if it is null.
        // 
        // Note that Java's Type Inferencing auto-converts the boxed java.lang.Long => 'long'
        // (auto-unboxes the returned reference to a long-primitive)
        
        int FLAGS = RETURN_DEFVAL_ON_NULL | RETURN_DEFVAL_ON_SPEX
        long val = ReadBoxedJSON.parseLong(jsonObj, "myProp", FLAGS , -1);
        
        Parameters:
        jo - Any instance of JsonObject
        propertyName - The name of the JSON property that should be contained within 'jo'. This property will be retrieved and subsequently transformed / converted to Java-Type java.lang.Long.
        FLAGS - Return-value / exception-throw constants defined in JFlag
        defaultValue - This is the 'Default Value' returned by this method, if there are any exception or problems converting or extracting the specified number.

        The default value is only returned by this method if the appropriate JSON Exception Flag has been passed to the 'FLAGS' parameter! Specifically, if 'FLAGS' were passed '0', then this parameter is fully-irrelevant and ignored. The exception flags are listed in inner-class JFlags

        AGAIN: If an exception-case is encountered, but the exception-flag for that exception has not been set, then this default-value won't be returned, and that exception will throw instead.
        optionalParser - Any function-pointer to a function that will transform / convert a java.lang.String into a java.lang.Long.

        NOTE: This parameter may be null, and if it is, the standard Java invocation of Long.parseLong(String.trim()) is used.
        Returns:
        If the JsonObject property contained a JsonString, and that string was successfully parsed to a java.lang.Long, then it is returned.
        If there were errors attempting to transform the String object-property, and the user-provided flags specified that defaultValue be returned, then that is returned. Null is returned if the flags specified it on error.

        If flags has been passed a '0', and an error-case has arisen, then the relevant exception will throw, instead.
        Throws:
        JsonPropMissingException - If 'jo' does not have a property with the name 'propertyName' and none of these Exception-Flags are set:
        JsonArithmeticObjException - If the number converstion function throws an ArithmeticException while attempting to convert the JsonString into a java.lang.Long, and none of these Exception-Flags are set:
        JsonStrParseObjException - If the JsonObject property specified by 'propertyName' throws an exception while attempting to parse the java.lang.String into a java.lang.Long, and none of these Exception-Flags are set:
        JsonNullObjException - If the JsonObject property specified by 'propertyName' contains Json-Null, rather than a JsonString, and none of these Exception-Flags are set:
        JsonTypeObjException - If the JsonObject property specified by 'propertyName' contains a some other Json-Type rather than JsonString, and none of these Exception-Flags are set:
        See Also:
        RJInternal.PARSE(JsonObject, String, int, Number, Class, Function, Function, Function)
        Code:
        Exact Method Body:
         return PARSE(
             jo, propertyName, FLAGS, defaultValue, Long.class, optionalParser,
             BigDecimal::longValueExact, BigDecimal::longValue
         );
        
      • getShort

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Short getShort​(JsonArray ja,
                                               int index)
        Retrieve a JsonArray element, and transform it to a java.lang.Short. If Json-Null is found - then Java-Null is returned.

        Boxed Java Null's:
        This method facilitates translating a Json-Null into a Java-Null since a Java Boxed-Type number is returned from this method, rather than a Java Primitive
        Parameters:
        ja - Any instance of JsonArray
        index - A valid index into array parameter 'ja'. In Json (and unlike Java), array element types are not actually checked for consistency - meaning an array may hold many different types! This array-index must contain a JsonNumber
        Returns:
        An instance of Java-Type java.lang.Short, if and only if the array element located at 'index' uses the appropriate Json-Type - JsonNumber. If that array-index contains some other type, or that JsonNumber cannot be properly transformed to a java.lang.Short, then an exception will throw.

        If the specified array-element inside 'ja' has been set to Json-Null, then Java-Null is returned.
        Throws:
        java.lang.IndexOutOfBoundsException - If 'index' is out of the bounds of 'ja'
        JsonTypeArrException - If the array-element (specified by 'index') does not actually contain a JsonNumber (but rather, some other non-null Json-Type), then this exception throws.
        JsonArithmeticArrException - Java's implementation of shortValueExact() throws an ArithmeticException when that method cannot correctly transform / convert the element to a valid java.lang.Short. The thrown-exception is then wrapped into this exception for the purpose of providing a much improved error-message, and convenience fields.
        See Also:
        RJInternal.GET(JsonArray, int, Function, Class), JsonNumber.bigDecimalValue()
        Code:
        Exact Method Body:
         return GET(ja, index, jn -> jn.bigDecimalValue().shortValueExact(), Short.class);
        
      • getShort

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Short getShort​(JsonArray ja,
                                               int index,
                                               int FLAGS,
                                               short defaultValue)
        Retrieve a JsonArray element, and transform it to a java.lang.Short. Please see the class documentation for JFlag for details about the error-handling flags provided by this method. Note that using the (lesser-known) Java-Syntax below, the flag-constants may be referenced without typing their full names at each use:

        // Note the use of the 'static' modifier here
        import static Torello.Java.Additional.JFlag.*;
        


        This method allows for many type-transformaton errors to be handled by converting the returned answer into either Java-Null, or a user-provided default-value (using the Flags). Additionally, if an ArithmeticException should throw, that exception-case can also be handled by using the default type-rounding mechanism java provides via method shortValue() (without the 'Exact' word appended to the method-name). See the Java Documentation for BigDecimal.shortValue() for an explanation about the behavior of flag RETURN_JAPPROX_ON_AEX and rounding a java.lang.Short

        Auto Un-Boxing:
        Java's compile-time type-magic allows a user to assign this method's Boxed-Type return-value to its matching Primitive Type (It is called automatic boxing and unboxing).

        Just make sure to remember that if this method does return null because of erroneous JSON, and because the germaine Exception-Flags aren't set, your code would throw a NullPointerException! Compile Time Type Inferencing allows for:

        Example:
        // If null is actually returned, this would throw NullPointerException
        short val = ReadBoxedJSON.getShort(jsonArray, 1, RETURN_NULL_ON_NULL, -1);
        
        // The following invocation gracefully returns a boxed '-1' if the array index is null,
        // or if the array index contains some non-integer number.
        // 
        // Note that Java's Type Inferencing auto-converts the boxed java.lang.Short => 'short'
        // (auto-unboxes the returned reference to a short-primitive)
        
        short val = ReadBoxedJSON.getShort
            (jsonArray, 1, RETURN_DEFVAL_ON_NULL | RETURN_DEFVAL_ON_AEX, -1);
        
        Parameters:
        ja - Any instance of JsonArray
        index - The array index containing the element to retrieve.
        FLAGS - Return-value / exception-throw constants defined in JFlag
        defaultValue - This is the 'Default Value' returned by this method, if there are any exception or problems converting or extracting the specified number.

        The default value is only returned by this method if the appropriate JSON Exception Flag has been passed to the 'FLAGS' parameter! Specifically, if 'FLAGS' were passed '0', then this parameter is fully-irrelevant and ignored. The exception flags are listed in inner-class JFlags

        AGAIN: If an exception-case is encountered, but the exception-flag for that exception has not been set, then this default-value won't be returned, and that exception will throw instead.
        Returns:
        If the JsonArray index contained a number, and that number was successfully transformed to a java.lang.Short, then it is returned.

        If there were errors attempting to transform the array-element, but the user-provided flags have specified that the defaultValue be returned, then that is returned. Null is returned if the flags have specified a null-return on error.

        If flags has been passed a '0', and an error-case has arisen, then, instead, the relevant exception will throw.
        Throws:
        java.lang.IndexOutOfBoundsException - If 'index' is out of the bounds of input array 'ja' and none of these Exception-Flags are set:
        JsonArithmeticArrException - If the number converstion function throws an ArithmeticException while attempting to convert the JsonNumber into a java.lang.Short, and none of these Exception-Flags are set:
        JsonNullArrException - If the JsonArray element located at 'index' contains Json-Null, rather than a JsonNumber, and none of these Exception-Flags are set:
        JsonTypeArrException - If the JsonArray element located at 'index' contains a some other Json-Type rather than JsonNumber, and none of these Exception-Flags are set:
        See Also:
        RJInternal.GET(JsonArray, int, int, Number, Class, Function, Function), JsonNumber.bigDecimalValue()
        Code:
        Exact Method Body:
         return GET(
             ja, index, FLAGS, defaultValue, Short.class,
             jn -> jn.bigDecimalValue().shortValueExact(),
             jn -> jn.bigDecimalValue().shortValue()
         );
        
      • parseShort

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Short parseShort​
                    (JsonArray ja,
                     int index,
                     int FLAGS,
                     short defaultValue,
                     java.util.function.Function<java.lang.String,​java.lang.Short> optionalParser)
        
        Retrieve a JsonArray element containing a JsonString, and transform it to a java.lang.Short, with either a user-provided parser, or the standard java short-integer parser Please see the class documentation for JFlag for details about the error-handling flags provided by this method. Note that using the (lesser-known) Java-Syntax below, the flag-constants may be referenced without typing their full names at each use:

        // Note the use of the 'static' modifier here
        import static Torello.Java.Additional.JFlag.*;
        


        This method allows for many type-transformaton errors to be handled by converting the returned answer into either Java-Null, or a user-provided default-value, using the 'FLAGS' parameter.

        Auto Un-Boxing:
        Java's compile-time type-magic allows a user to assign this method's Boxed-Type return-value to its matching Primitive Type (It is called automatic boxing and unboxing).

        Just make sure to remember that if this method does return null because of erroneous JSON, and because the germaine Exception-Flags aren't set, your code would throw a NullPointerException! Compile Time Type Inferencing allows for:

        Example:
        // If null is actually returned, this would throw NullPointerException
        short val = ReadBoxedJSON.parseShort(jsonArray, 1, RETURN_NULL_ON_NULL, -1, null);
        
        // The following invocation gracefully returns a boxed '-1' if the array index contains
        // an 'unparseable' String (or is null)
        // 
        // Note that Java's Type Inferencing auto-converts the boxed java.lang.Short => 'short'
        // (auto-unboxes the returned reference to a short-primitive)
        
        int FLAGS = RETURN_DEFVAL_ON_NULL | RETURN_DEFVAL_ON_SPEX;
        short val = ReadBoxedJSON.parseShort(jsonArray, 1, FLAGS, -1, null);
        
        Parameters:
        ja - Any instance of JsonArray
        index - The array index containing the JsonString element to retrieve.
        FLAGS - Return-value / exception-throw constants defined in JFlag
        defaultValue - This is the 'Default Value' returned by this method, if there are any exception or problems converting or extracting the specified number.

        The default value is only returned by this method if the appropriate JSON Exception Flag has been passed to the 'FLAGS' parameter! Specifically, if 'FLAGS' were passed '0', then this parameter is fully-irrelevant and ignored. The exception flags are listed in inner-class JFlags

        AGAIN: If an exception-case is encountered, but the exception-flag for that exception has not been set, then this default-value won't be returned, and that exception will throw instead.
        optionalParser - Any function-pointer to a function that will transform / convert a java.lang.String into a java.lang.Short.

        NOTE: This parameter may be null, and if it is, the standard Java invocation of Short.parseShort(String.trim()) is used.
        Returns:
        If the JsonArray index contained a JsonString, and that string was successfully parsed to a java.lang.Short, then it is returned.
        If there were errors attempting to transform the String array-element, and the user-provided flags specified that defaultValue be returned, then that is returned. Null is returned if the flags specified it on error.

        If flags has been passed a '0', and an error-case has arisen, then the relevant exception will throw, instead.
        Throws:
        java.lang.IndexOutOfBoundsException - If 'index' is out of the bounds of input array 'ja' and none of these Exception-Flags are set:
        JsonArithmeticArrException - If the number converstion function throws an ArithmeticException while attempting to convert the JsonString into a java.lang.Short, and none of these Exception-Flags are set:
        JsonStrParseArrException - If the JsonArray element located at 'index' throws an exception while attempting to parse the java.lang.String into a java.lang.Short, and none of these Exception-Flags are set:
        JsonNullArrException - If the JsonArray element located at 'index' contains Json-Null, rather than a JsonString, and none of these Exception-Flags are set:
        JsonTypeArrException - If the JsonArray element located at 'index' contains a some other Json-Type rather than JsonString, and none of these Exception-Flags are set:
        See Also:
        RJInternal.PARSE(JsonObject, String, int, Number, Class, Function, Function, Function)
        Code:
        Exact Method Body:
         return PARSE(
             ja, index, FLAGS, defaultValue, Short.class, optionalParser,
             BigDecimal::shortValueExact, BigDecimal::shortValue
         );
        
      • getShort

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Short getShort​(JsonObject jo,
                                               java.lang.String propertyName,
                                               boolean isOptional)
        Extract a JsonObject property, and transform it to a java.lang.Short. If Json-Null is found - then Java-Null is returned.

        Boxed Java Null's:
        This method facilitates translating a Json-Null into a Java-Null since a Java Boxed-Type number is returned from this method, rather than a Java Primitive
        Parameters:
        jo - Any instance of JsonObject.
        propertyName - The name of the JSON property that should be contained within 'jo'. This property will be retrieved and subsequently transformed / converted to Java-Type java.lang.Short.
        isOptional - When TRUE is passed, if 'propertyName' is not actually listed in 'jo' this method shall return Java-Null gracefully. When FALSE is passed, if 'jo' does not have the specified property, a JsonPropMissingException will throw.

        If 'jo' actually has a property named 'propertyName', then the value passed to this parameter is fully irrelevant.
        Returns:
        An instance of Java-Type java.lang.Short, if and only if the 'propertyName' is available inside 'jo', and that property uses the appropriate Json-Type - JsonNumber

        If the specified property has been set to 'null' (Json-Null) in the passed JsonObject, then Java-Null is returned. Java-Null is also returned if 'propertyName' is not listed / unavailable in 'jo' and TRUE has been passed to 'isOptional'.

        Other cases shall generate an exception throw.
        Throws:
        JsonPropMissingException - This exception shall throw if the specified property is missing from the 'JsonObject' (parameter 'jo'). This exception throw can be avoided if 'TRUE' is passed to parameter 'isOptional'.
        JsonArithmeticObjException - Java's implementation of shortValueExact() throws an ArithmeticException when that method cannot correctly transform / convert the element to a valid java.lang.Short. The thrown-exception is then wrapped into this exception for the purpose of providing a much improved error-message, and convenience fields.
        JsonTypeObjException - If the property (specified by 'propertyName') is extracted, but that property does not actually contain a JsonNumber (but rather, some other non-null Json-Type), then this exception throws.
        See Also:
        RJInternal.GET(JsonObject, String, boolean, Function, Class), JsonNumber.bigDecimalValue()
        Code:
        Exact Method Body:
         return GET(
             jo, propertyName, isOptional, jn -> jn.bigDecimalValue().shortValueExact(),
             Short.class
         );
        
      • getShort

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Short getShort​(JsonObject jo,
                                               java.lang.String propertyName,
                                               int FLAGS,
                                               short defaultValue)
        Retrieve a JsonObject property, and transform it to a java.lang.Short. Please see the class documentation for JFlag for details about the error-handling flags provided by this method. Note that using the (lesser-known) Java-Syntax below, the flag-constants may be referenced without typing their full names at each use:

        // Note the use of the 'static' modifier here
        import static Torello.Java.Additional.JFlag.*;
        


        This method allows for many type-transformaton errors to be handled by converting the returned answer into either Java-Null, or a user-provided default-value (using the Flags). Additionally, if an ArithmeticException should throw, that exception-case can also be handled by using the default type-rounding mechanism java provides via method intValue() (without the 'Exact' word appended to the method-name). See the Java Documentation for BigDecimal.intValue() for an explanation about the behavior of flag RETURN_JAPPROX_ON_AEX and rounding a java.lang.Short

        Auto Un-Boxing:
        Java's compile-time type-magic allows a user to assign this method's Boxed-Type return-value to its matching Primitive Type (It is called automatic boxing and unboxing).

        Just make sure to remember that if this method does return null because of erroneous JSON, and because the germaine Exception-Flags aren't set, your code would throw a NullPointerException! Compile Time Type Inferencing allows for:

        Example:
        // If null is actually returned, this would throw NullPointerException
        int val = ReadBoxedJSON.getShort(jsonObj, "myProp", RETURN_NULL_ON_NULL -1);
        
        // The following invocation gracefully returns a boxed '-1' if the property contains a
        // null, or if the property holds some non-integer number.
        // 
        // Note that Java's Type Inferencing auto-converts the boxed java.lang.Short => 'int'
        // (auto-unboxes the returned reference to a int-primitive)
        
        int val = ReadBoxedJSON.getShort
            (jsonObj, "myProp", RETURN_DEFVAL_ON_NULL & RETURN_DEFVAL_ON_AEX, -1);
        
        Parameters:
        jo - Any instance of JsonObject
        propertyName - The name of the JSON property that should be contained within 'jo'. This property will be retrieved and subsequently transformed / converted to Java-Type java.lang.Short.
        FLAGS - Return-value / exception-throw constants defined in JFlag
        defaultValue - This is the 'Default Value' returned by this method, if there are any exception or problems converting or extracting the specified number.

        The default value is only returned by this method if the appropriate JSON Exception Flag has been passed to the 'FLAGS' parameter! Specifically, if 'FLAGS' were passed '0', then this parameter is fully-irrelevant and ignored. The exception flags are listed in inner-class JFlags

        AGAIN: If an exception-case is encountered, but the exception-flag for that exception has not been set, then this default-value won't be returned, and that exception will throw instead.
        Returns:
        If the JsonObject property contained a number, and that number was successfully transformed to a java.lang.Short, then it is returned.

        If there were errors attempting to transform the object-property, and the user-provided flags have specified that the defaultValue be returned, then that is returned. Null is returned if the flags have specified a null-return on error.

        If flags has been passed a '0', and an error-case has arisen, then, instead, the relevant exception will throw.
        Throws:
        JsonPropMissingException - If 'jo' does not have a property with the name 'propertyName' and none of these Exception-Flags are set:
        JsonArithmeticObjException - If the number converstion function throws an ArithmeticException while attempting to convert the JsonNumber into a java.lang.Short, and none of these Exception-Flags are set:
        JsonNullObjException - If the JsonObject property specified by 'propertyName' contains Json-Null, rather than a JsonNumber, and none of these Exception-Flags are set:
        JsonTypeObjException - If the JsonObject property specified by 'propertyName' contains a some other Json-Type rather than JsonNumber, and none of these Exception-Flags are set:
        See Also:
        RJInternal.GET(JsonObject, String, int, Number, Class, Function, Function), JsonNumber.bigDecimalValue()
        Code:
        Exact Method Body:
         return GET(
             jo, propertyName, FLAGS, defaultValue, Short.class,
             jn -> jn.bigDecimalValue().shortValueExact(),
             jn -> jn.bigDecimalValue().shortValue()
         );
        
      • parseShort

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Short parseShort​
                    (JsonObject jo,
                     java.lang.String propertyName,
                     int FLAGS,
                     short defaultValue,
                     java.util.function.Function<java.lang.String,​java.lang.Short> optionalParser)
        
        Retrieve a JsonObject property containing a JsonString, and transform it to a java.lang.Short, with either a user-provided parser, or the standard java short-integer parser Please see the class documentation for JFlag for details about the error-handling flags provided by this method. Note that using the (lesser-known) Java-Syntax below, the flag-constants may be referenced without typing their full names at each use:

        // Note the use of the 'static' modifier here
        import static Torello.Java.Additional.JFlag.*;
        


        This method allows for many type-transformaton errors to be handled by converting the returned answer into either Java-Null, or a user-provided default-value, using the 'FLAGS' parameter.

        Auto Un-Boxing:
        Java's compile-time type-magic allows a user to assign this method's Boxed-Type return-value to its matching Primitive Type (It is called automatic boxing and unboxing).

        Just make sure to remember that if this method does return null because of erroneous JSON, and because the germaine Exception-Flags aren't set, your code would throw a NullPointerException! Compile Time Type Inferencing allows for:

        Example:
        // If null is actually returned, this would throw NullPointerException
        short val = ReadBoxedJSON.parseShort(jsonObj, "myProp", RETURN_NULL_ON_NULL, -1);
        
        // The following invocation gracefully returns a boxed '-1' if the property contains an
        // 'unparseable' String, or if it is null.
        // 
        // Note that Java's Type Inferencing auto-converts the boxed java.lang.Short => 'short'
        // (auto-unboxes the returned reference to a short-primitive)
        
        int FLAGS = RETURN_DEFVAL_ON_NULL | RETURN_DEFVAL_ON_SPEX
        short val = ReadBoxedJSON.parseShort(jsonObj, "myProp", FLAGS , -1);
        
        Parameters:
        jo - Any instance of JsonObject
        propertyName - The name of the JSON property that should be contained within 'jo'. This property will be retrieved and subsequently transformed / converted to Java-Type java.lang.Short.
        FLAGS - Return-value / exception-throw constants defined in JFlag
        defaultValue - This is the 'Default Value' returned by this method, if there are any exception or problems converting or extracting the specified number.

        The default value is only returned by this method if the appropriate JSON Exception Flag has been passed to the 'FLAGS' parameter! Specifically, if 'FLAGS' were passed '0', then this parameter is fully-irrelevant and ignored. The exception flags are listed in inner-class JFlags

        AGAIN: If an exception-case is encountered, but the exception-flag for that exception has not been set, then this default-value won't be returned, and that exception will throw instead.
        optionalParser - Any function-pointer to a function that will transform / convert a java.lang.String into a java.lang.Short.

        NOTE: This parameter may be null, and if it is, the standard Java invocation of Short.parseShort(String.trim()) is used.
        Returns:
        If the JsonObject property contained a JsonString, and that string was successfully parsed to a java.lang.Short, then it is returned.
        If there were errors attempting to transform the String object-property, and the user-provided flags specified that defaultValue be returned, then that is returned. Null is returned if the flags specified it on error.

        If flags has been passed a '0', and an error-case has arisen, then the relevant exception will throw, instead.
        Throws:
        JsonPropMissingException - If 'jo' does not have a property with the name 'propertyName' and none of these Exception-Flags are set:
        JsonArithmeticObjException - If the number converstion function throws an ArithmeticException while attempting to convert the JsonString into a java.lang.Short, and none of these Exception-Flags are set:
        JsonStrParseObjException - If the JsonObject property specified by 'propertyName' throws an exception while attempting to parse the java.lang.String into a java.lang.Short, and none of these Exception-Flags are set:
        JsonNullObjException - If the JsonObject property specified by 'propertyName' contains Json-Null, rather than a JsonString, and none of these Exception-Flags are set:
        JsonTypeObjException - If the JsonObject property specified by 'propertyName' contains a some other Json-Type rather than JsonString, and none of these Exception-Flags are set:
        See Also:
        RJInternal.PARSE(JsonObject, String, int, Number, Class, Function, Function, Function)
        Code:
        Exact Method Body:
         return PARSE(
             jo, propertyName, FLAGS, defaultValue, Short.class, optionalParser,
             BigDecimal::shortValueExact, BigDecimal::shortValue
         );
        
      • getByte

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Byte getByte​(JsonArray ja,
                                             int index)
        Retrieve a JsonArray element, and transform it to a java.lang.Byte. If Json-Null is found - then Java-Null is returned.

        Boxed Java Null's:
        This method facilitates translating a Json-Null into a Java-Null since a Java Boxed-Type number is returned from this method, rather than a Java Primitive
        Parameters:
        ja - Any instance of JsonArray
        index - A valid index into array parameter 'ja'. In Json (and unlike Java), array element types are not actually checked for consistency - meaning an array may hold many different types! This array-index must contain a JsonNumber
        Returns:
        An instance of Java-Type java.lang.Byte, if and only if the array element located at 'index' uses the appropriate Json-Type - JsonNumber. If that array-index contains some other type, or that JsonNumber cannot be properly transformed to a java.lang.Byte, then an exception will throw.

        If the specified array-element inside 'ja' has been set to Json-Null, then Java-Null is returned.
        Throws:
        java.lang.IndexOutOfBoundsException - If 'index' is out of the bounds of 'ja'
        JsonTypeArrException - If the array-element (specified by 'index') does not actually contain a JsonNumber (but rather, some other non-null Json-Type), then this exception throws.
        JsonArithmeticArrException - Java's implementation of byteValueExact() throws an ArithmeticException when that method cannot correctly transform / convert the element to a valid java.lang.Byte. The thrown-exception is then wrapped into this exception for the purpose of providing a much improved error-message, and convenience fields.
        See Also:
        RJInternal.GET(JsonArray, int, Function, Class), JsonNumber.bigDecimalValue()
        Code:
        Exact Method Body:
         return GET(ja, index, jn -> jn.bigDecimalValue().byteValueExact(), Byte.class);
        
      • getByte

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Byte getByte​(JsonArray ja,
                                             int index,
                                             int FLAGS,
                                             byte defaultValue)
        Retrieve a JsonArray element, and transform it to a java.lang.Byte. Please see the class documentation for JFlag for details about the error-handling flags provided by this method. Note that using the (lesser-known) Java-Syntax below, the flag-constants may be referenced without typing their full names at each use:

        // Note the use of the 'static' modifier here
        import static Torello.Java.Additional.JFlag.*;
        


        This method allows for many type-transformaton errors to be handled by converting the returned answer into either Java-Null, or a user-provided default-value (using the Flags). Additionally, if an ArithmeticException should throw, that exception-case can also be handled by using the default type-rounding mechanism java provides via method byteValue() (without the 'Exact' word appended to the method-name). See the Java Documentation for BigDecimal.byteValue() for an explanation about the behavior of flag RETURN_JAPPROX_ON_AEX and rounding a java.lang.Byte

        Auto Un-Boxing:
        Java's compile-time type-magic allows a user to assign this method's Boxed-Type return-value to its matching Primitive Type (It is called automatic boxing and unboxing).

        Just make sure to remember that if this method does return null because of erroneous JSON, and because the germaine Exception-Flags aren't set, your code would throw a NullPointerException! Compile Time Type Inferencing allows for:

        Example:
        // If null is actually returned, this would throw NullPointerException
        byte val = ReadBoxedJSON.getByte(jsonArray, 1, RETURN_NULL_ON_NULL, -1);
        
        // The following invocation gracefully returns a boxed '-1' if the array index is null,
        // or if the array index contains some non-integer number.
        // 
        // Note that Java's Type Inferencing auto-converts the boxed java.lang.Byte => 'byte'
        // (auto-unboxes the returned reference to a byte-primitive)
        
        byte val = ReadBoxedJSON.getByte
            (jsonArray, 1, RETURN_DEFVAL_ON_NULL | RETURN_DEFVAL_ON_AEX, -1);
        
        Parameters:
        ja - Any instance of JsonArray
        index - The array index containing the element to retrieve.
        FLAGS - Return-value / exception-throw constants defined in JFlag
        defaultValue - This is the 'Default Value' returned by this method, if there are any exception or problems converting or extracting the specified number.

        The default value is only returned by this method if the appropriate JSON Exception Flag has been passed to the 'FLAGS' parameter! Specifically, if 'FLAGS' were passed '0', then this parameter is fully-irrelevant and ignored. The exception flags are listed in inner-class JFlags

        AGAIN: If an exception-case is encountered, but the exception-flag for that exception has not been set, then this default-value won't be returned, and that exception will throw instead.
        Returns:
        If the JsonArray index contained a number, and that number was successfully transformed to a java.lang.Byte, then it is returned.

        If there were errors attempting to transform the array-element, but the user-provided flags have specified that the defaultValue be returned, then that is returned. Null is returned if the flags have specified a null-return on error.

        If flags has been passed a '0', and an error-case has arisen, then, instead, the relevant exception will throw.
        Throws:
        java.lang.IndexOutOfBoundsException - If 'index' is out of the bounds of input array 'ja' and none of these Exception-Flags are set:
        JsonArithmeticArrException - If the number converstion function throws an ArithmeticException while attempting to convert the JsonNumber into a java.lang.Byte, and none of these Exception-Flags are set:
        JsonNullArrException - If the JsonArray element located at 'index' contains Json-Null, rather than a JsonNumber, and none of these Exception-Flags are set:
        JsonTypeArrException - If the JsonArray element located at 'index' contains a some other Json-Type rather than JsonNumber, and none of these Exception-Flags are set:
        See Also:
        RJInternal.GET(JsonArray, int, int, Number, Class, Function, Function), JsonNumber.bigDecimalValue()
        Code:
        Exact Method Body:
         return GET(
             ja, index, FLAGS, defaultValue, Byte.class,
             jn -> jn.bigDecimalValue().byteValueExact(),
             jn -> jn.bigDecimalValue().byteValue()
         );
        
      • parseByte

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Byte parseByte​
                    (JsonArray ja,
                     int index,
                     int FLAGS,
                     byte defaultValue,
                     java.util.function.Function<java.lang.String,​java.lang.Byte> optionalParser)
        
        Retrieve a JsonArray element containing a JsonString, and transform it to a java.lang.Byte, with either a user-provided parser, or the standard java byte parser Please see the class documentation for JFlag for details about the error-handling flags provided by this method. Note that using the (lesser-known) Java-Syntax below, the flag-constants may be referenced without typing their full names at each use:

        // Note the use of the 'static' modifier here
        import static Torello.Java.Additional.JFlag.*;
        


        This method allows for many type-transformaton errors to be handled by converting the returned answer into either Java-Null, or a user-provided default-value, using the 'FLAGS' parameter.

        Auto Un-Boxing:
        Java's compile-time type-magic allows a user to assign this method's Boxed-Type return-value to its matching Primitive Type (It is called automatic boxing and unboxing).

        Just make sure to remember that if this method does return null because of erroneous JSON, and because the germaine Exception-Flags aren't set, your code would throw a NullPointerException! Compile Time Type Inferencing allows for:

        Example:
        // If null is actually returned, this would throw NullPointerException
        byte val = ReadBoxedJSON.parseByte(jsonArray, 1, RETURN_NULL_ON_NULL, -1, null);
        
        // The following invocation gracefully returns a boxed '-1' if the array index contains
        // an 'unparseable' String (or is null)
        // 
        // Note that Java's Type Inferencing auto-converts the boxed java.lang.Byte => 'byte'
        // (auto-unboxes the returned reference to a byte-primitive)
        
        int FLAGS = RETURN_DEFVAL_ON_NULL | RETURN_DEFVAL_ON_SPEX;
        byte val = ReadBoxedJSON.parseByte(jsonArray, 1, FLAGS, -1, null);
        
        Parameters:
        ja - Any instance of JsonArray
        index - The array index containing the JsonString element to retrieve.
        FLAGS - Return-value / exception-throw constants defined in JFlag
        defaultValue - This is the 'Default Value' returned by this method, if there are any exception or problems converting or extracting the specified number.

        The default value is only returned by this method if the appropriate JSON Exception Flag has been passed to the 'FLAGS' parameter! Specifically, if 'FLAGS' were passed '0', then this parameter is fully-irrelevant and ignored. The exception flags are listed in inner-class JFlags

        AGAIN: If an exception-case is encountered, but the exception-flag for that exception has not been set, then this default-value won't be returned, and that exception will throw instead.
        optionalParser - Any function-pointer to a function that will transform / convert a java.lang.String into a java.lang.Byte.

        NOTE: This parameter may be null, and if it is, the standard Java invocation of Byte.parseByte(String.trim()) is used.
        Returns:
        If the JsonArray index contained a JsonString, and that string was successfully parsed to a java.lang.Byte, then it is returned.
        If there were errors attempting to transform the String array-element, and the user-provided flags specified that defaultValue be returned, then that is returned. Null is returned if the flags specified it on error.

        If flags has been passed a '0', and an error-case has arisen, then the relevant exception will throw, instead.
        Throws:
        java.lang.IndexOutOfBoundsException - If 'index' is out of the bounds of input array 'ja' and none of these Exception-Flags are set:
        JsonArithmeticArrException - If the number converstion function throws an ArithmeticException while attempting to convert the JsonString into a java.lang.Byte, and none of these Exception-Flags are set:
        JsonStrParseArrException - If the JsonArray element located at 'index' throws an exception while attempting to parse the java.lang.String into a java.lang.Byte, and none of these Exception-Flags are set:
        JsonNullArrException - If the JsonArray element located at 'index' contains Json-Null, rather than a JsonString, and none of these Exception-Flags are set:
        JsonTypeArrException - If the JsonArray element located at 'index' contains a some other Json-Type rather than JsonString, and none of these Exception-Flags are set:
        See Also:
        RJInternal.PARSE(JsonObject, String, int, Number, Class, Function, Function, Function)
        Code:
        Exact Method Body:
         return PARSE(
             ja, index, FLAGS, defaultValue, Byte.class, optionalParser,
             BigDecimal::byteValueExact, BigDecimal::byteValue
         );
        
      • getByte

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Byte getByte​(JsonObject jo,
                                             java.lang.String propertyName,
                                             boolean isOptional)
        Extract a JsonObject property, and transform it to a java.lang.Byte. If Json-Null is found - then Java-Null is returned.

        Boxed Java Null's:
        This method facilitates translating a Json-Null into a Java-Null since a Java Boxed-Type number is returned from this method, rather than a Java Primitive
        Parameters:
        jo - Any instance of JsonObject.
        propertyName - The name of the JSON property that should be contained within 'jo'. This property will be retrieved and subsequently transformed / converted to Java-Type java.lang.Byte.
        isOptional - When TRUE is passed, if 'propertyName' is not actually listed in 'jo' this method shall return Java-Null gracefully. When FALSE is passed, if 'jo' does not have the specified property, a JsonPropMissingException will throw.

        If 'jo' actually has a property named 'propertyName', then the value passed to this parameter is fully irrelevant.
        Returns:
        An instance of Java-Type java.lang.Byte, if and only if the 'propertyName' is available inside 'jo', and that property uses the appropriate Json-Type - JsonNumber

        If the specified property has been set to 'null' (Json-Null) in the passed JsonObject, then Java-Null is returned. Java-Null is also returned if 'propertyName' is not listed / unavailable in 'jo' and TRUE has been passed to 'isOptional'.

        Other cases shall generate an exception throw.
        Throws:
        JsonPropMissingException - This exception shall throw if the specified property is missing from the 'JsonObject' (parameter 'jo'). This exception throw can be avoided if 'TRUE' is passed to parameter 'isOptional'.
        JsonArithmeticObjException - Java's implementation of byteValueExact() throws an ArithmeticException when that method cannot correctly transform / convert the element to a valid java.lang.Byte. The thrown-exception is then wrapped into this exception for the purpose of providing a much improved error-message, and convenience fields.
        JsonTypeObjException - If the property (specified by 'propertyName') is extracted, but that property does not actually contain a JsonNumber (but rather, some other non-null Json-Type), then this exception throws.
        See Also:
        RJInternal.GET(JsonObject, String, boolean, Function, Class), JsonNumber.bigDecimalValue()
        Code:
        Exact Method Body:
         return GET(
             jo, propertyName, isOptional, jn -> jn.bigDecimalValue().byteValueExact(),
             Byte.class
         );
        
      • getByte

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Byte getByte​(JsonObject jo,
                                             java.lang.String propertyName,
                                             int FLAGS,
                                             byte defaultValue)
        Retrieve a JsonObject property, and transform it to a java.lang.Byte. Please see the class documentation for JFlag for details about the error-handling flags provided by this method. Note that using the (lesser-known) Java-Syntax below, the flag-constants may be referenced without typing their full names at each use:

        // Note the use of the 'static' modifier here
        import static Torello.Java.Additional.JFlag.*;
        


        This method allows for many type-transformaton errors to be handled by converting the returned answer into either Java-Null, or a user-provided default-value (using the Flags). Additionally, if an ArithmeticException should throw, that exception-case can also be handled by using the default type-rounding mechanism java provides via method intValue() (without the 'Exact' word appended to the method-name). See the Java Documentation for BigDecimal.intValue() for an explanation about the behavior of flag RETURN_JAPPROX_ON_AEX and rounding a java.lang.Byte

        Auto Un-Boxing:
        Java's compile-time type-magic allows a user to assign this method's Boxed-Type return-value to its matching Primitive Type (It is called automatic boxing and unboxing).

        Just make sure to remember that if this method does return null because of erroneous JSON, and because the germaine Exception-Flags aren't set, your code would throw a NullPointerException! Compile Time Type Inferencing allows for:

        Example:
        // If null is actually returned, this would throw NullPointerException
        int val = ReadBoxedJSON.getByte(jsonObj, "myProp", RETURN_NULL_ON_NULL -1);
        
        // The following invocation gracefully returns a boxed '-1' if the property contains a
        // null, or if the property holds some non-integer number.
        // 
        // Note that Java's Type Inferencing auto-converts the boxed java.lang.Byte => 'int'
        // (auto-unboxes the returned reference to a int-primitive)
        
        int val = ReadBoxedJSON.getByte
            (jsonObj, "myProp", RETURN_DEFVAL_ON_NULL & RETURN_DEFVAL_ON_AEX, -1);
        
        Parameters:
        jo - Any instance of JsonObject
        propertyName - The name of the JSON property that should be contained within 'jo'. This property will be retrieved and subsequently transformed / converted to Java-Type java.lang.Byte.
        FLAGS - Return-value / exception-throw constants defined in JFlag
        defaultValue - This is the 'Default Value' returned by this method, if there are any exception or problems converting or extracting the specified number.

        The default value is only returned by this method if the appropriate JSON Exception Flag has been passed to the 'FLAGS' parameter! Specifically, if 'FLAGS' were passed '0', then this parameter is fully-irrelevant and ignored. The exception flags are listed in inner-class JFlags

        AGAIN: If an exception-case is encountered, but the exception-flag for that exception has not been set, then this default-value won't be returned, and that exception will throw instead.
        Returns:
        If the JsonObject property contained a number, and that number was successfully transformed to a java.lang.Byte, then it is returned.

        If there were errors attempting to transform the object-property, and the user-provided flags have specified that the defaultValue be returned, then that is returned. Null is returned if the flags have specified a null-return on error.

        If flags has been passed a '0', and an error-case has arisen, then, instead, the relevant exception will throw.
        Throws:
        JsonPropMissingException - If 'jo' does not have a property with the name 'propertyName' and none of these Exception-Flags are set:
        JsonArithmeticObjException - If the number converstion function throws an ArithmeticException while attempting to convert the JsonNumber into a java.lang.Byte, and none of these Exception-Flags are set:
        JsonNullObjException - If the JsonObject property specified by 'propertyName' contains Json-Null, rather than a JsonNumber, and none of these Exception-Flags are set:
        JsonTypeObjException - If the JsonObject property specified by 'propertyName' contains a some other Json-Type rather than JsonNumber, and none of these Exception-Flags are set:
        See Also:
        RJInternal.GET(JsonObject, String, int, Number, Class, Function, Function), JsonNumber.bigDecimalValue()
        Code:
        Exact Method Body:
         return GET(
             jo, propertyName, FLAGS, defaultValue, Byte.class,
             jn -> jn.bigDecimalValue().byteValueExact(),
             jn -> jn.bigDecimalValue().byteValue()
         );
        
      • parseByte

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Byte parseByte​
                    (JsonObject jo,
                     java.lang.String propertyName,
                     int FLAGS,
                     byte defaultValue,
                     java.util.function.Function<java.lang.String,​java.lang.Byte> optionalParser)
        
        Retrieve a JsonObject element containing a JsonString, and transform it to a java.lang.Byte, with either a user-provided parser, or the standard java byte parser Please see the class documentation for JFlag for details about the error-handling flags provided by this method. Note that using the (lesser-known) Java-Syntax below, the flag-constants may be referenced without typing their full names at each use:

        // Note the use of the 'static' modifier here
        import static Torello.Java.Additional.JFlag.*;
        


        This method allows for many type-transformaton errors to be handled by converting the returned answer into either Java-Null, or a user-provided default-value, using the 'FLAGS' parameter.

        Auto Un-Boxing:
        Java's compile-time type-magic allows a user to assign this method's Boxed-Type return-value to its matching Primitive Type (It is called automatic boxing and unboxing).

        Just make sure to remember that if this method does return null because of erroneous JSON, and because the germaine Exception-Flags aren't set, your code would throw a NullPointerException! Compile Time Type Inferencing allows for:

        Example:
        // If null is actually returned, this would throw NullPointerException
        byte val = ReadBoxedJSON.parseByte(jsonObj, "myProp", RETURN_NULL_ON_NULL, -1);
        
        // The following invocation gracefully returns a boxed '-1' if the property contains an
        // 'unparseable' String, or if it is null.
        // 
        // Note that Java's Type Inferencing auto-converts the boxed java.lang.Byte => 'byte'
        // (auto-unboxes the returned reference to a byte-primitive)
        
        int FLAGS = RETURN_DEFVAL_ON_NULL | RETURN_DEFVAL_ON_SPEX
        byte val = ReadBoxedJSON.parseByte(jsonObj, "myProp", FLAGS , -1);
        
        Parameters:
        jo - Any instance of JsonObject
        propertyName - The name of the JSON property that should be contained within 'jo'. This property will be retrieved and subsequently transformed / converted to Java-Type java.lang.Byte.
        FLAGS - Return-value / exception-throw constants defined in JFlag
        defaultValue - This is the 'Default Value' returned by this method, if there are any exception or problems converting or extracting the specified number.

        The default value is only returned by this method if the appropriate JSON Exception Flag has been passed to the 'FLAGS' parameter! Specifically, if 'FLAGS' were passed '0', then this parameter is fully-irrelevant and ignored. The exception flags are listed in inner-class JFlags

        AGAIN: If an exception-case is encountered, but the exception-flag for that exception has not been set, then this default-value won't be returned, and that exception will throw instead.
        optionalParser - Any function-pointer to a function that will transform / convert a java.lang.String into a java.lang.Byte.

        NOTE: This parameter may be null, and if it is, the standard Java invocation of Byte.parseByte(String.trim()) is used.
        Returns:
        If the JsonObject property contained a JsonString, and that string was successfully parsed to a java.lang.Byte, then it is returned.
        If there were errors attempting to transform the String object-property, and the user-provided flags specified that defaultValue be returned, then that is returned. Null is returned if the flags specified it on error.

        If flags has been passed a '0', and an error-case has arisen, then the relevant exception will throw, instead.
        Throws:
        JsonPropMissingException - If 'jo' does not have a property with the name 'propertyName' and none of these Exception-Flags are set:
        JsonArithmeticObjException - If the number converstion function throws an ArithmeticException while attempting to convert the JsonString into a java.lang.Byte, and none of these Exception-Flags are set:
        JsonStrParseObjException - If the JsonObject property specified by 'propertyName' throws an exception while attempting to parse the java.lang.String into a java.lang.Byte, and none of these Exception-Flags are set:
        JsonNullObjException - If the JsonObject property specified by 'propertyName' contains Json-Null, rather than a JsonString, and none of these Exception-Flags are set:
        JsonTypeObjException - If the JsonObject property specified by 'propertyName' contains a some other Json-Type rather than JsonString, and none of these Exception-Flags are set:
        See Also:
        RJInternal.PARSE(JsonObject, String, int, Number, Class, Function, Function, Function)
        Code:
        Exact Method Body:
         return PARSE(
             jo, propertyName, FLAGS, defaultValue, Byte.class, optionalParser,
             BigDecimal::byteValueExact, BigDecimal::byteValue
         );
        
      • getDouble

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Double getDouble​(JsonArray ja,
                                                 int index)
        Retrieve a JsonArray element, and transform it to a java.lang.Double. If Json-Null is found - then Java-Null is returned.

        Boxed Java Null's:
        This method facilitates translating a Json-Null into a Java-Null since a Java Boxed-Type number is returned from this method, rather than a Java Primitive

        NOTE: If the precision of the provided JsonNumber contains too much information, the extra digits will simply be lost; no exceptions will throw; and the method shall return a rounded answer - gracefully.

        If the magnitude of the number is too large or too small, an ArithmeticException will throw, as explained below.
        Parameters:
        ja - Any instance of JsonArray
        index - A valid index into array parameter 'ja'. In Json (and unlike Java), array element types are not actually checked for consistency - meaning an array may hold many different types! This array-index must contain a JsonNumber
        Returns:
        An instance of Java-Type java.lang.Double, if and only if the array element located at 'index' uses the appropriate Json-Type - JsonNumber. If that array-index contains some other type, or that JsonNumber cannot be properly transformed to a java.lang.Double, then an exception will throw.

        If the specified array-element inside 'ja' has been set to Json-Null, then Java-Null is returned.
        Throws:
        java.lang.IndexOutOfBoundsException - If 'index' is out of the bounds of 'ja'
        JsonTypeArrException - If the array-element (specified by 'index') does not actually contain a JsonNumber (but rather, some other non-null Json-Type), then this exception throws.
        JsonArithmeticArrException - Java's implementation of BigDecimal.doubleValue() will return an infinity constant (Double.NEGATIVE_INFINITY or Double.POSITIVE_INFINITY) when the magnitude of the returned value is too large to fit inside the Java Type java.lang.Double.

        This method checks for the infinity constants, and then proceeds to throw this exception when they are detected.
        See Also:
        RJInternal.GET(JsonArray, int, Function, Class), RJInternal.DOUBLE_WITH_CHECK(JsonNumber)
        Code:
        Exact Method Body:
         return GET(ja, index, RJInternal::DOUBLE_WITH_CHECK, Double.class);
        
      • getDouble

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Double getDouble​(JsonArray ja,
                                                 int index,
                                                 int FLAGS,
                                                 double defaultValue)
        Retrieve a JsonArray element, and transform it to a java.lang.Double. Please see the class documentation for JFlag for details about the error-handling flags provided by this method. Note that using the (lesser-known) Java-Syntax below, the flag-constants may be referenced without typing their full names at each use:

        // Note the use of the 'static' modifier here
        import static Torello.Java.Additional.JFlag.*;
        


        This method allows for many type-transformaton errors to be handled by converting the returned answer into either Java-Null, or a user-provided default-value (using the Flags). Additionally, if an ArithmeticException should throw, that exception-case can also be handled by using the default type-rounding mechanism java provides via method doubleValue() (without the 'Exact' word appended to the method-name). See the Java Documentation for BigDecimal.doubleValue() for an explanation about the behavior of flag RETURN_JAPPROX_ON_AEX and rounding a java.lang.Double

        Auto Un-Boxing:
        Java's compile-time type-magic allows a user to assign this method's Boxed-Type return-value to its matching Primitive Type (It is called automatic boxing and unboxing).

        Just make sure to remember that if this method does return null because of erroneous JSON, and because the germaine Exception-Flags aren't set, your code would throw a NullPointerException! Compile Time Type Inferencing allows for:

        Example:
        // If null is actually returned, this would throw NullPointerException
        double val = ReadBoxedJSON.getDouble(jsonArray, 1, RETURN_NULL_ON_NULL, -1);
        
        // The following invocation gracefully returns a boxed '-1' if the array index is null,
        // or if the array index contains some non-integer number.
        // 
        // Note that Java's Type Inferencing auto-converts the boxed java.lang.Double => 'double'
        // (auto-unboxes the returned reference to a double-primitive)
        
        double val = ReadBoxedJSON.getDouble
            (jsonArray, 1, RETURN_DEFVAL_ON_NULL | RETURN_DEFVAL_ON_AEX, -1);
        
        Parameters:
        ja - Any instance of JsonArray
        index - The array index containing the element to retrieve.
        FLAGS - Return-value / exception-throw constants defined in JFlag
        defaultValue - This is the 'Default Value' returned by this method, if there are any exception or problems converting or extracting the specified number.

        The default value is only returned by this method if the appropriate JSON Exception Flag has been passed to the 'FLAGS' parameter! Specifically, if 'FLAGS' were passed '0', then this parameter is fully-irrelevant and ignored. The exception flags are listed in inner-class JFlags

        AGAIN: If an exception-case is encountered, but the exception-flag for that exception has not been set, then this default-value won't be returned, and that exception will throw instead.
        Returns:
        If the JsonArray index contained a number, and that number was successfully transformed to a java.lang.Double, then it is returned.

        If there were errors attempting to transform the array-element, but the user-provided flags have specified that the defaultValue be returned, then that is returned. Null is returned if the flags have specified a null-return on error.

        If flags has been passed a '0', and an error-case has arisen, then, instead, the relevant exception will throw.
        Throws:
        java.lang.IndexOutOfBoundsException - If 'index' is out of the bounds of input array 'ja' and none of these Exception-Flags are set:
        JsonArithmeticArrException - If the number converstion function throws an ArithmeticException while attempting to convert the JsonNumber into a java.lang.Double, and none of these Exception-Flags are set:
        JsonNullArrException - If the JsonArray element located at 'index' contains Json-Null, rather than a JsonNumber, and none of these Exception-Flags are set:
        JsonTypeArrException - If the JsonArray element located at 'index' contains a some other Json-Type rather than JsonNumber, and none of these Exception-Flags are set:
        See Also:
        RJInternal.GET(JsonArray, int, int, Number, Class, Function, Function), RJInternal.DOUBLE_WITH_CHECK(JsonNumber), JsonNumber.bigDecimalValue()
        Code:
        Exact Method Body:
         return GET(
             ja, index, FLAGS, defaultValue, Double.class,
             RJInternal::DOUBLE_WITH_CHECK, jn -> jn.bigDecimalValue().doubleValue()
         );
        
      • parseDouble

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Double parseDouble​
                    (JsonArray ja,
                     int index,
                     int FLAGS,
                     double defaultValue,
                     java.util.function.Function<java.lang.String,​java.lang.Double> optionalParser)
        
        Retrieve a JsonArray element containing a JsonString, and transform it to a java.lang.Double, with either a user-provided parser, or the standard java double parser Please see the class documentation for JFlag for details about the error-handling flags provided by this method. Note that using the (lesser-known) Java-Syntax below, the flag-constants may be referenced without typing their full names at each use:

        // Note the use of the 'static' modifier here
        import static Torello.Java.Additional.JFlag.*;
        


        This method allows for many type-transformaton errors to be handled by converting the returned answer into either Java-Null, or a user-provided default-value, using the 'FLAGS' parameter.

        Auto Un-Boxing:
        Java's compile-time type-magic allows a user to assign this method's Boxed-Type return-value to its matching Primitive Type (It is called automatic boxing and unboxing).

        Just make sure to remember that if this method does return null because of erroneous JSON, and because the germaine Exception-Flags aren't set, your code would throw a NullPointerException! Compile Time Type Inferencing allows for:

        Example:
        // If null is actually returned, this would throw NullPointerException
        double val = ReadBoxedJSON.parseDouble(jsonArray, 1, RETURN_NULL_ON_NULL, -1, null);
        
        // The following invocation gracefully returns a boxed '-1' if the array index contains
        // an 'unparseable' String (or is null)
        // 
        // Note that Java's Type Inferencing auto-converts the boxed java.lang.Double => 'double'
        // (auto-unboxes the returned reference to a double-primitive)
        
        int FLAGS = RETURN_DEFVAL_ON_NULL | RETURN_DEFVAL_ON_SPEX;
        double val = ReadBoxedJSON.parseDouble(jsonArray, 1, FLAGS, -1, null);
        
        Parameters:
        ja - Any instance of JsonArray
        index - The array index containing the JsonString element to retrieve.
        FLAGS - Return-value / exception-throw constants defined in JFlag
        defaultValue - This is the 'Default Value' returned by this method, if there are any exception or problems converting or extracting the specified number.

        The default value is only returned by this method if the appropriate JSON Exception Flag has been passed to the 'FLAGS' parameter! Specifically, if 'FLAGS' were passed '0', then this parameter is fully-irrelevant and ignored. The exception flags are listed in inner-class JFlags

        AGAIN: If an exception-case is encountered, but the exception-flag for that exception has not been set, then this default-value won't be returned, and that exception will throw instead.
        optionalParser - Any function-pointer to a function that will transform / convert a java.lang.String into a java.lang.Double.

        NOTE: This parameter may be null, and if it is, the standard Java invocation of Double.parseDouble(String.trim()) is used.
        Returns:
        If the JsonArray index contained a JsonString, and that string was successfully parsed to a java.lang.Double, then it is returned.
        If there were errors attempting to transform the String array-element, and the user-provided flags specified that defaultValue be returned, then that is returned. Null is returned if the flags specified it on error.

        If flags has been passed a '0', and an error-case has arisen, then the relevant exception will throw, instead.
        Throws:
        java.lang.IndexOutOfBoundsException - If 'index' is out of the bounds of input array 'ja' and none of these Exception-Flags are set:
        JsonArithmeticArrException - If the number converstion function throws an ArithmeticException while attempting to convert the JsonString into a java.lang.Double, and none of these Exception-Flags are set:
        JsonArithmeticArrException - If the number converstion function throws an ArithmeticException while attempting to convert the JsonString into a java.lang.Double, and none of these Exception-Flags are set:
        JsonStrParseArrException - If the JsonArray element located at 'index' throws an exception while attempting to parse the java.lang.String into a java.lang.Double, and none of these Exception-Flags are set:
        JsonNullArrException - If the JsonArray element located at 'index' contains Json-Null, rather than a JsonString, and none of these Exception-Flags are set:
        JsonTypeArrException - If the JsonArray element located at 'index' contains a some other Json-Type rather than JsonString, and none of these Exception-Flags are set:
        See Also:
        RJInternal.PARSE(JsonObject, String, int, Number, Class, Function, Function, Function)
        Code:
        Exact Method Body:
         return PARSE(
             ja, index, FLAGS, defaultValue, Double.class, optionalParser,
             RJInternal::DOUBLE_WITH_CHECK, BigDecimal::doubleValue
         );
        
      • getDouble

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Double getDouble​(JsonObject jo,
                                                 java.lang.String propertyName,
                                                 boolean isOptional)
        Extract a JsonObject property, and transform it to a java.lang.Double. If Json-Null is found - then Java-Null is returned.

        Boxed Java Null's:
        This method facilitates translating a Json-Null into a Java-Null since a Java Boxed-Type number is returned from this method, rather than a Java Primitive

        NOTE: If the precision of the provided JsonNumber contains too much information, the extra digits will simply be lost; no exceptions will throw; and the method shall return a rounded answer - gracefully.

        If the magnitude of the number is too large or too small, an ArithmeticException will throw, as explained below.
        Parameters:
        jo - Any instance of JsonObject.
        propertyName - The name of the JSON property that should be contained within 'jo'. This property will be retrieved and subsequently transformed / converted to Java-Type java.lang.Double.
        isOptional - When TRUE is passed, if 'propertyName' is not actually listed in 'jo' this method shall return Java-Null gracefully. When FALSE is passed, if 'jo' does not have the specified property, a JsonPropMissingException will throw.

        If 'jo' actually has a property named 'propertyName', then the value passed to this parameter is fully irrelevant.
        Returns:
        An instance of Java-Type java.lang.Double, if and only if the 'propertyName' is available inside 'jo', and that property uses the appropriate Json-Type - JsonNumber

        If the specified property has been set to 'null' (Json-Null) in the passed JsonObject, then Java-Null is returned. Java-Null is also returned if 'propertyName' is not listed / unavailable in 'jo' and TRUE has been passed to 'isOptional'.

        Other cases shall generate an exception throw.
        Throws:
        JsonPropMissingException - This exception shall throw if the specified property is missing from the 'JsonObject' (parameter 'jo'). This exception throw can be avoided if 'TRUE' is passed to parameter 'isOptional'.
        JsonArithmeticObjException - Java's implementation of BigDecimal.doubleValue() will return an infinity constant (Double.NEGATIVE_INFINITY or Double.POSITIVE_INFINITY) when the magnitude of the returned value is too large to fit inside the Java Type java.lang.Double.

        This method checks for the infinity constants, and then proceeds to throw this exception when they are detected.
        JsonTypeObjException - If the property (specified by 'propertyName') is extracted, but that property does not actually contain a JsonNumber (but rather, some other non-null Json-Type), then this exception throws.
        See Also:
        RJInternal.GET(JsonObject, String, boolean, Function, Class), RJInternal.DOUBLE_WITH_CHECK(JsonNumber)
        Code:
        Exact Method Body:
         return GET(jo, propertyName, isOptional, RJInternal::DOUBLE_WITH_CHECK, Double.class);
        
      • getDouble

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Double getDouble​(JsonObject jo,
                                                 java.lang.String propertyName,
                                                 int FLAGS,
                                                 double defaultValue)
        Retrieve a JsonObject property, and transform it to a java.lang.Double. Please see the class documentation for JFlag for details about the error-handling flags provided by this method. Note that using the (lesser-known) Java-Syntax below, the flag-constants may be referenced without typing their full names at each use:

        // Note the use of the 'static' modifier here
        import static Torello.Java.Additional.JFlag.*;
        


        This method allows for many type-transformaton errors to be handled by converting the returned answer into either Java-Null, or a user-provided default-value (using the Flags). Additionally, if an ArithmeticException should throw, that exception-case can also be handled by using the default type-rounding mechanism java provides via method doubleValue() (without the 'Exact' word appended to the method-name). See the Java Documentation for BigDecimal.doubleValue() for an explanation about the behavior of flag RETURN_JAPPROX_ON_AEX and rounding a java.lang.Double

        Auto Un-Boxing:
        Java's compile-time type-magic allows a user to assign this method's Boxed-Type return-value to its matching Primitive Type (It is called automatic boxing and unboxing).

        Just make sure to remember that if this method does return null because of erroneous JSON, and because the germaine Exception-Flags aren't set, your code would throw a NullPointerException! Compile Time Type Inferencing allows for:

        Example:
        // If null is actually returned, this would throw NullPointerException
        double val = ReadBoxedJSON.getDouble(jsonObj, "myProp", RETURN_NULL_ON_NULL -1);
        
        // The following invocation gracefully returns a boxed '-1' if the property contains a
        // null, or if the property holds some non-integer number.
        // 
        // Note that Java's Type Inferencing auto-converts the boxed java.lang.Double => 'double'
        // (auto-unboxes the returned reference to a double-primitive)
        
        double val = ReadBoxedJSON.getDouble
            (jsonObj, "myProp", RETURN_DEFVAL_ON_NULL & RETURN_DEFVAL_ON_AEX, -1);
        
        Parameters:
        jo - Any instance of JsonObject
        propertyName - The name of the JSON property that should be contained within 'jo'. This property will be retrieved and subsequently transformed / converted to Java-Type java.lang.Double.
        FLAGS - Return-value / exception-throw constants defined in JFlag
        defaultValue - This is the 'Default Value' returned by this method, if there are any exception or problems converting or extracting the specified number.

        The default value is only returned by this method if the appropriate JSON Exception Flag has been passed to the 'FLAGS' parameter! Specifically, if 'FLAGS' were passed '0', then this parameter is fully-irrelevant and ignored. The exception flags are listed in inner-class JFlags

        AGAIN: If an exception-case is encountered, but the exception-flag for that exception has not been set, then this default-value won't be returned, and that exception will throw instead.
        Returns:
        If the JsonObject property contained a number, and that number was successfully transformed to a java.lang.Double, then it is returned.

        If there were errors attempting to transform the object-property, and the user-provided flags have specified that the defaultValue be returned, then that is returned. Null is returned if the flags have specified a null-return on error.

        If flags has been passed a '0', and an error-case has arisen, then, instead, the relevant exception will throw.
        Throws:
        JsonPropMissingException - If 'jo' does not have a property with the name 'propertyName' and none of these Exception-Flags are set:
        JsonArithmeticObjException - Java's implementation of doubleValue() throws an ArithmeticException when that method cannot correctly transform / convert the element to a valid java.lang.Double. The thrown-exception is then wrapped into this exception for the purpose of providing a much improved error-message, and convenience fields.
        JsonNullObjException - If the JsonObject property specified by 'propertyName' contains Json-Null, rather than a JsonNumber, and none of these Exception-Flags are set:
        JsonTypeObjException - If the JsonObject property specified by 'propertyName' contains a some other Json-Type rather than JsonNumber, and none of these Exception-Flags are set:
        See Also:
        RJInternal.GET(JsonObject, String, int, Number, Class, Function, Function), RJInternal.DOUBLE_WITH_CHECK(JsonNumber), JsonNumber.bigDecimalValue()
        Code:
        Exact Method Body:
         return GET(
             jo, propertyName, FLAGS, defaultValue, Double.class,
             RJInternal::DOUBLE_WITH_CHECK, jn -> jn.bigDecimalValue().doubleValue()
         );
        
      • parseDouble

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Double parseDouble​
                    (JsonObject jo,
                     java.lang.String propertyName,
                     int FLAGS,
                     double defaultValue,
                     java.util.function.Function<java.lang.String,​java.lang.Double> optionalParser)
        
        Retrieve a JsonObject property containing a JsonString, and transform it to a java.lang.Double, with either a user-provided parser, or the standard java double parser Please see the class documentation for JFlag for details about the error-handling flags provided by this method. Note that using the (lesser-known) Java-Syntax below, the flag-constants may be referenced without typing their full names at each use:

        // Note the use of the 'static' modifier here
        import static Torello.Java.Additional.JFlag.*;
        


        This method allows for many type-transformaton errors to be handled by converting the returned answer into either Java-Null, or a user-provided default-value, using the 'FLAGS' parameter.

        Auto Un-Boxing:
        Java's compile-time type-magic allows a user to assign this method's Boxed-Type return-value to its matching Primitive Type (It is called automatic boxing and unboxing).

        Just make sure to remember that if this method does return null because of erroneous JSON, and because the germaine Exception-Flags aren't set, your code would throw a NullPointerException! Compile Time Type Inferencing allows for:

        Example:
        // If null is actually returned, this would throw NullPointerException
        double val = ReadBoxedJSON.parseDouble(jsonObj, "myProp", RETURN_NULL_ON_NULL, -1);
        
        // The following invocation gracefully returns a boxed '-1' if the property contains an
        // 'unparseable' String, or if it is null.
        // 
        // Note that Java's Type Inferencing auto-converts the boxed java.lang.Double => 'double'
        // (auto-unboxes the returned reference to a double-primitive)
        
        int FLAGS = RETURN_DEFVAL_ON_NULL | RETURN_DEFVAL_ON_SPEX
        double val = ReadBoxedJSON.parseDouble(jsonObj, "myProp", FLAGS , -1);
        
        Parameters:
        jo - Any instance of JsonObject
        propertyName - The name of the JSON property that should be contained within 'jo'. This property will be retrieved and subsequently transformed / converted to Java-Type java.lang.Double.
        FLAGS - Return-value / exception-throw constants defined in JFlag
        defaultValue - This is the 'Default Value' returned by this method, if there are any exception or problems converting or extracting the specified number.

        The default value is only returned by this method if the appropriate JSON Exception Flag has been passed to the 'FLAGS' parameter! Specifically, if 'FLAGS' were passed '0', then this parameter is fully-irrelevant and ignored. The exception flags are listed in inner-class JFlags

        AGAIN: If an exception-case is encountered, but the exception-flag for that exception has not been set, then this default-value won't be returned, and that exception will throw instead.
        optionalParser - Any function-pointer to a function that will transform / convert a java.lang.String into a java.lang.Double.

        NOTE: This parameter may be null, and if it is, the standard Java invocation of Double.parseDouble(String.trim()) is used.
        Returns:
        If the JsonObject property contained a JsonString, and that string was successfully parsed to a java.lang.Double, then it is returned.
        If there were errors attempting to transform the String object-property, and the user-provided flags specified that defaultValue be returned, then that is returned. Null is returned if the flags specified it on error.

        If flags has been passed a '0', and an error-case has arisen, then the relevant exception will throw, instead.
        Throws:
        JsonPropMissingException - If 'jo' does not have a property with the name 'propertyName' and none of these Exception-Flags are set:
        JsonArithmeticObjException - If the number converstion function throws an ArithmeticException while attempting to convert the JsonString into a java.lang.Double, and none of these Exception-Flags are set:
        JsonStrParseObjException - If the JsonObject property specified by 'propertyName' throws an exception while attempting to parse the java.lang.String into a java.lang.Double, and none of these Exception-Flags are set:
        JsonNullObjException - If the JsonObject property specified by 'propertyName' contains Json-Null, rather than a JsonString, and none of these Exception-Flags are set:
        JsonTypeObjException - If the JsonObject property specified by 'propertyName' contains a some other Json-Type rather than JsonString, and none of these Exception-Flags are set:
        See Also:
        RJInternal.PARSE(JsonObject, String, int, Number, Class, Function, Function, Function)
        Code:
        Exact Method Body:
         return PARSE(
             jo, propertyName, FLAGS, defaultValue, Double.class, optionalParser,
             RJInternal::DOUBLE_WITH_CHECK, BigDecimal::doubleValue
         );
        
      • getFloat

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Float getFloat​(JsonArray ja,
                                               int index)
        Retrieve a JsonArray element, and transform it to a java.lang.Float. If Json-Null is found - then Java-Null is returned.

        Boxed Java Null's:
        This method facilitates translating a Json-Null into a Java-Null since a Java Boxed-Type number is returned from this method, rather than a Java Primitive

        NOTE: If the precision of the provided JsonNumber contains too much information, the extra digits will simply be lost; no exceptions will throw; and the method shall return a rounded answer - gracefully.

        If the magnitude of the number is too large or too small, an ArithmeticException will throw, as explained below.
        Parameters:
        ja - Any instance of JsonArray
        index - A valid index into array parameter 'ja'. In Json (and unlike Java), array element types are not actually checked for consistency - meaning an array may hold many different types! This array-index must contain a JsonNumber
        Returns:
        An instance of Java-Type java.lang.Float, if and only if the array element located at 'index' uses the appropriate Json-Type - JsonNumber. If that array-index contains some other type, or that JsonNumber cannot be properly transformed to a java.lang.Float, then an exception will throw.

        If the specified array-element inside 'ja' has been set to Json-Null, then Java-Null is returned.
        Throws:
        java.lang.IndexOutOfBoundsException - If 'index' is out of the bounds of 'ja'
        JsonTypeArrException - If the array-element (specified by 'index') does not actually contain a JsonNumber (but rather, some other non-null Json-Type), then this exception throws.
        JsonArithmeticArrException - Java's implementation of BigDecimal.floatValue() will return an infinity constant (Float.NEGATIVE_INFINITY or Float.POSITIVE_INFINITY) when the magnitude of the returned value is too large to fit inside the Java Type java.lang.Float.

        This method checks for the infinity constants, and then proceeds to throw this exception when they are detected.
        See Also:
        RJInternal.GET(JsonArray, int, Function, Class), RJInternal.FLOAT_WITH_CHECK(JsonNumber)
        Code:
        Exact Method Body:
         return GET(ja, index, RJInternal::FLOAT_WITH_CHECK, Float.class);
        
      • getFloat

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Float getFloat​(JsonArray ja,
                                               int index,
                                               int FLAGS,
                                               float defaultValue)
        Retrieve a JsonArray element, and transform it to a java.lang.Float. Please see the class documentation for JFlag for details about the error-handling flags provided by this method. Note that using the (lesser-known) Java-Syntax below, the flag-constants may be referenced without typing their full names at each use:

        // Note the use of the 'static' modifier here
        import static Torello.Java.Additional.JFlag.*;
        


        This method allows for many type-transformaton errors to be handled by converting the returned answer into either Java-Null, or a user-provided default-value (using the Flags). Additionally, if an ArithmeticException should throw, that exception-case can also be handled by using the default type-rounding mechanism java provides via method floatValue() (without the 'Exact' word appended to the method-name). See the Java Documentation for BigDecimal.floatValue() for an explanation about the behavior of flag RETURN_JAPPROX_ON_AEX and rounding a java.lang.Float

        Auto Un-Boxing:
        Java's compile-time type-magic allows a user to assign this method's Boxed-Type return-value to its matching Primitive Type (It is called automatic boxing and unboxing).

        Just make sure to remember that if this method does return null because of erroneous JSON, and because the germaine Exception-Flags aren't set, your code would throw a NullPointerException! Compile Time Type Inferencing allows for:

        Example:
        // If null is actually returned, this would throw NullPointerException
        float val = ReadBoxedJSON.getFloat(jsonArray, 1, RETURN_NULL_ON_NULL, -1);
        
        // The following invocation gracefully returns a boxed '-1' if the array index is null,
        // or if the array index contains some non-integer number.
        // 
        // Note that Java's Type Inferencing auto-converts the boxed java.lang.Float => 'float'
        // (auto-unboxes the returned reference to a float-primitive)
        
        float val = ReadBoxedJSON.getFloat
            (jsonArray, 1, RETURN_DEFVAL_ON_NULL | RETURN_DEFVAL_ON_AEX, -1);
        
        Parameters:
        ja - Any instance of JsonArray
        index - The array index containing the element to retrieve.
        FLAGS - Return-value / exception-throw constants defined in JFlag
        defaultValue - This is the 'Default Value' returned by this method, if there are any exception or problems converting or extracting the specified number.

        The default value is only returned by this method if the appropriate JSON Exception Flag has been passed to the 'FLAGS' parameter! Specifically, if 'FLAGS' were passed '0', then this parameter is fully-irrelevant and ignored. The exception flags are listed in inner-class JFlags

        AGAIN: If an exception-case is encountered, but the exception-flag for that exception has not been set, then this default-value won't be returned, and that exception will throw instead.
        Returns:
        If the JsonArray index contained a number, and that number was successfully transformed to a java.lang.Float, then it is returned.

        If there were errors attempting to transform the array-element, but the user-provided flags have specified that the defaultValue be returned, then that is returned. Null is returned if the flags have specified a null-return on error.

        If flags has been passed a '0', and an error-case has arisen, then, instead, the relevant exception will throw.
        Throws:
        java.lang.IndexOutOfBoundsException - If 'index' is out of the bounds of input array 'ja' and none of these Exception-Flags are set:
        JsonArithmeticArrException - If the number converstion function throws an ArithmeticException while attempting to convert the JsonNumber into a java.lang.Float, and none of these Exception-Flags are set:
        JsonNullArrException - If the JsonArray element located at 'index' contains Json-Null, rather than a JsonNumber, and none of these Exception-Flags are set:
        JsonTypeArrException - If the JsonArray element located at 'index' contains a some other Json-Type rather than JsonNumber, and none of these Exception-Flags are set:
        See Also:
        RJInternal.GET(JsonArray, int, int, Number, Class, Function, Function), RJInternal.FLOAT_WITH_CHECK(JsonNumber), JsonNumber.bigDecimalValue()
        Code:
        Exact Method Body:
         return GET(
             ja, index, FLAGS, defaultValue, Float.class,
             RJInternal::FLOAT_WITH_CHECK, jn -> jn.bigDecimalValue().floatValue()
         );
        
      • parseFloat

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Float parseFloat​
                    (JsonArray ja,
                     int index,
                     int FLAGS,
                     float defaultValue,
                     java.util.function.Function<java.lang.String,​java.lang.Float> optionalParser)
        
        Retrieve a JsonArray element containing a JsonString, and transform it to a java.lang.Float, with either a user-provided parser, or the standard java float parser Please see the class documentation for JFlag for details about the error-handling flags provided by this method. Note that using the (lesser-known) Java-Syntax below, the flag-constants may be referenced without typing their full names at each use:

        // Note the use of the 'static' modifier here
        import static Torello.Java.Additional.JFlag.*;
        


        This method allows for many type-transformaton errors to be handled by converting the returned answer into either Java-Null, or a user-provided default-value, using the 'FLAGS' parameter.

        Auto Un-Boxing:
        Java's compile-time type-magic allows a user to assign this method's Boxed-Type return-value to its matching Primitive Type (It is called automatic boxing and unboxing).

        Just make sure to remember that if this method does return null because of erroneous JSON, and because the germaine Exception-Flags aren't set, your code would throw a NullPointerException! Compile Time Type Inferencing allows for:

        Example:
        // If null is actually returned, this would throw NullPointerException
        float val = ReadBoxedJSON.parseFloat(jsonArray, 1, RETURN_NULL_ON_NULL, -1, null);
        
        // The following invocation gracefully returns a boxed '-1' if the array index contains
        // an 'unparseable' String (or is null)
        // 
        // Note that Java's Type Inferencing auto-converts the boxed java.lang.Float => 'float'
        // (auto-unboxes the returned reference to a float-primitive)
        
        int FLAGS = RETURN_DEFVAL_ON_NULL | RETURN_DEFVAL_ON_SPEX;
        float val = ReadBoxedJSON.parseFloat(jsonArray, 1, FLAGS, -1, null);
        
        Parameters:
        ja - Any instance of JsonArray
        index - The array index containing the JsonString element to retrieve.
        FLAGS - Return-value / exception-throw constants defined in JFlag
        defaultValue - This is the 'Default Value' returned by this method, if there are any exception or problems converting or extracting the specified number.

        The default value is only returned by this method if the appropriate JSON Exception Flag has been passed to the 'FLAGS' parameter! Specifically, if 'FLAGS' were passed '0', then this parameter is fully-irrelevant and ignored. The exception flags are listed in inner-class JFlags

        AGAIN: If an exception-case is encountered, but the exception-flag for that exception has not been set, then this default-value won't be returned, and that exception will throw instead.
        optionalParser - Any function-pointer to a function that will transform / convert a java.lang.String into a java.lang.Float.

        NOTE: This parameter may be null, and if it is, the standard Java invocation of Float.parseFloat(String.trim()) is used.
        Returns:
        If the JsonArray index contained a JsonString, and that string was successfully parsed to a java.lang.Float, then it is returned.
        If there were errors attempting to transform the String array-element, and the user-provided flags specified that defaultValue be returned, then that is returned. Null is returned if the flags specified it on error.

        If flags has been passed a '0', and an error-case has arisen, then the relevant exception will throw, instead.
        Throws:
        java.lang.IndexOutOfBoundsException - If 'index' is out of the bounds of input array 'ja' and none of these Exception-Flags are set:
        JsonArithmeticArrException - If the number converstion function throws an ArithmeticException while attempting to convert the JsonString into a java.lang.Float, and none of these Exception-Flags are set:
        JsonStrParseArrException - If the JsonArray element located at 'index' throws an exception while attempting to parse the java.lang.String into a java.lang.Float, and none of these Exception-Flags are set:
        JsonNullArrException - If the JsonArray element located at 'index' contains Json-Null, rather than a JsonString, and none of these Exception-Flags are set:
        JsonTypeArrException - If the JsonArray element located at 'index' contains a some other Json-Type rather than JsonString, and none of these Exception-Flags are set:
        See Also:
        RJInternal.PARSE(JsonObject, String, int, Number, Class, Function, Function, Function)
        Code:
        Exact Method Body:
         return PARSE(
             ja, index, FLAGS, defaultValue, Float.class, optionalParser,
             RJInternal::FLOAT_WITH_CHECK, BigDecimal::floatValue
         );
        
      • getFloat

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Float getFloat​(JsonObject jo,
                                               java.lang.String propertyName,
                                               boolean isOptional)
        Extract a JsonObject property, and transform it to a java.lang.Float. If Json-Null is found - then Java-Null is returned.

        Boxed Java Null's:
        This method facilitates translating a Json-Null into a Java-Null since a Java Boxed-Type number is returned from this method, rather than a Java Primitive

        NOTE: If the precision of the provided JsonNumber contains too much information, the extra digits will simply be lost; no exceptions will throw; and the method shall return a rounded answer - gracefully.

        If the magnitude of the number is too large or too small, an ArithmeticException will throw, as explained below.
        Parameters:
        jo - Any instance of JsonObject.
        propertyName - The name of the JSON property that should be contained within 'jo'. This property will be retrieved and subsequently transformed / converted to Java-Type java.lang.Float.
        isOptional - When TRUE is passed, if 'propertyName' is not actually listed in 'jo' this method shall return Java-Null gracefully. When FALSE is passed, if 'jo' does not have the specified property, a JsonPropMissingException will throw.

        If 'jo' actually has a property named 'propertyName', then the value passed to this parameter is fully irrelevant.
        Returns:
        An instance of Java-Type java.lang.Float, if and only if the 'propertyName' is available inside 'jo', and that property uses the appropriate Json-Type - JsonNumber

        If the specified property has been set to 'null' (Json-Null) in the passed JsonObject, then Java-Null is returned. Java-Null is also returned if 'propertyName' is not listed / unavailable in 'jo' and TRUE has been passed to 'isOptional'.

        Other cases shall generate an exception throw.
        Throws:
        JsonPropMissingException - This exception shall throw if the specified property is missing from the 'JsonObject' (parameter 'jo'). This exception throw can be avoided if 'TRUE' is passed to parameter 'isOptional'.
        JsonArithmeticObjException - Java's implementation of BigDecimal.floatValue() will return an infinity constant (Float.NEGATIVE_INFINITY or Float.POSITIVE_INFINITY) when the magnitude of the returned value is too large to fit inside the Java Type java.lang.Float.

        This method checks for the infinity constants, and then proceeds to throw this exception when they are detected.
        JsonTypeObjException - If the property (specified by 'propertyName') is extracted, but that property does not actually contain a JsonNumber (but rather, some other non-null Json-Type), then this exception throws.
        See Also:
        RJInternal.GET(JsonObject, String, boolean, Function, Class), RJInternal.FLOAT_WITH_CHECK(JsonNumber)
        Code:
        Exact Method Body:
         return GET(jo, propertyName, isOptional, RJInternal::FLOAT_WITH_CHECK, Float.class);
        
      • getFloat

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Float getFloat​(JsonObject jo,
                                               java.lang.String propertyName,
                                               int FLAGS,
                                               float defaultValue)
        Retrieve a JsonObject property, and transform it to a java.lang.Float. Please see the class documentation for JFlag for details about the error-handling flags provided by this method. Note that using the (lesser-known) Java-Syntax below, the flag-constants may be referenced without typing their full names at each use:

        // Note the use of the 'static' modifier here
        import static Torello.Java.Additional.JFlag.*;
        


        This method allows for many type-transformaton errors to be handled by converting the returned answer into either Java-Null, or a user-provided default-value (using the Flags). Additionally, if an ArithmeticException should throw, that exception-case can also be handled by using the default type-rounding mechanism java provides via method intValue() (without the 'Exact' word appended to the method-name). See the Java Documentation for BigDecimal.intValue() for an explanation about the behavior of flag RETURN_JAPPROX_ON_AEX and rounding a java.lang.Float

        Auto Un-Boxing:
        Java's compile-time type-magic allows a user to assign this method's Boxed-Type return-value to its matching Primitive Type (It is called automatic boxing and unboxing).

        Just make sure to remember that if this method does return null because of erroneous JSON, and because the germaine Exception-Flags aren't set, your code would throw a NullPointerException! Compile Time Type Inferencing allows for:

        Example:
        // If null is actually returned, this would throw NullPointerException
        int val = ReadBoxedJSON.getFloat(jsonObj, "myProp", RETURN_NULL_ON_NULL -1);
        
        // The following invocation gracefully returns a boxed '-1' if the property contains a
        // null, or if the property holds some non-integer number.
        // 
        // Note that Java's Type Inferencing auto-converts the boxed java.lang.Float => 'int'
        // (auto-unboxes the returned reference to a int-primitive)
        
        int val = ReadBoxedJSON.getFloat
            (jsonObj, "myProp", RETURN_DEFVAL_ON_NULL & RETURN_DEFVAL_ON_AEX, -1);
        
        Parameters:
        jo - Any instance of JsonObject
        propertyName - The name of the JSON property that should be contained within 'jo'. This property will be retrieved and subsequently transformed / converted to Java-Type java.lang.Float.
        FLAGS - Return-value / exception-throw constants defined in JFlag
        defaultValue - This is the 'Default Value' returned by this method, if there are any exception or problems converting or extracting the specified number.

        The default value is only returned by this method if the appropriate JSON Exception Flag has been passed to the 'FLAGS' parameter! Specifically, if 'FLAGS' were passed '0', then this parameter is fully-irrelevant and ignored. The exception flags are listed in inner-class JFlags

        AGAIN: If an exception-case is encountered, but the exception-flag for that exception has not been set, then this default-value won't be returned, and that exception will throw instead.
        Returns:
        If the JsonObject property contained a number, and that number was successfully transformed to a java.lang.Float, then it is returned.

        If there were errors attempting to transform the object-property, and the user-provided flags have specified that the defaultValue be returned, then that is returned. Null is returned if the flags have specified a null-return on error.

        If flags has been passed a '0', and an error-case has arisen, then, instead, the relevant exception will throw.
        Throws:
        JsonPropMissingException - If 'jo' does not have a property with the name 'propertyName' and none of these Exception-Flags are set:
        JsonArithmeticObjException - If the number converstion function throws an ArithmeticException while attempting to convert the JsonNumber into a java.lang.Float, and none of these Exception-Flags are set:
        JsonNullObjException - If the JsonObject property specified by 'propertyName' contains Json-Null, rather than a JsonNumber, and none of these Exception-Flags are set:
        JsonTypeObjException - If the JsonObject property specified by 'propertyName' contains a some other Json-Type rather than JsonNumber, and none of these Exception-Flags are set:
        See Also:
        RJInternal.GET(JsonObject, String, int, Number, Class, Function, Function), RJInternal.FLOAT_WITH_CHECK(JsonNumber), JsonNumber.bigDecimalValue()
        Code:
        Exact Method Body:
         return GET(
             jo, propertyName, FLAGS, defaultValue, Float.class,
             RJInternal::FLOAT_WITH_CHECK, jn -> jn.bigDecimalValue().floatValue()
         );
        
      • parseFloat

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Float parseFloat​
                    (JsonObject jo,
                     java.lang.String propertyName,
                     int FLAGS,
                     float defaultValue,
                     java.util.function.Function<java.lang.String,​java.lang.Float> parser)
        
        Retrieve a JsonObject property containing a JsonString, and transform it to a java.lang.Float, with either a user-provided parser, or the standard java float parser Please see the class documentation for JFlag for details about the error-handling flags provided by this method. Note that using the (lesser-known) Java-Syntax below, the flag-constants may be referenced without typing their full names at each use:

        // Note the use of the 'static' modifier here
        import static Torello.Java.Additional.JFlag.*;
        


        This method allows for many type-transformaton errors to be handled by converting the returned answer into either Java-Null, or a user-provided default-value, using the 'FLAGS' parameter.

        Auto Un-Boxing:
        Java's compile-time type-magic allows a user to assign this method's Boxed-Type return-value to its matching Primitive Type (It is called automatic boxing and unboxing).

        Just make sure to remember that if this method does return null because of erroneous JSON, and because the germaine Exception-Flags aren't set, your code would throw a NullPointerException! Compile Time Type Inferencing allows for:

        Example:
        // If null is actually returned, this would throw NullPointerException
        float val = ReadBoxedJSON.parseFloat(jsonObj, "myProp", RETURN_NULL_ON_NULL, -1);
        
        // The following invocation gracefully returns a boxed '-1' if the property contains an
        // 'unparseable' String, or if it is null.
        // 
        // Note that Java's Type Inferencing auto-converts the boxed java.lang.Float => 'float'
        // (auto-unboxes the returned reference to a float-primitive)
        
        int FLAGS = RETURN_DEFVAL_ON_NULL | RETURN_DEFVAL_ON_SPEX
        float val = ReadBoxedJSON.parseFloat(jsonObj, "myProp", FLAGS , -1);
        
        Parameters:
        jo - Any instance of JsonObject
        propertyName - The name of the JSON property that should be contained within 'jo'. This property will be retrieved and subsequently transformed / converted to Java-Type java.lang.Float.
        FLAGS - Return-value / exception-throw constants defined in JFlag
        defaultValue - This is the 'Default Value' returned by this method, if there are any exception or problems converting or extracting the specified number.

        The default value is only returned by this method if the appropriate JSON Exception Flag has been passed to the 'FLAGS' parameter! Specifically, if 'FLAGS' were passed '0', then this parameter is fully-irrelevant and ignored. The exception flags are listed in inner-class JFlags

        AGAIN: If an exception-case is encountered, but the exception-flag for that exception has not been set, then this default-value won't be returned, and that exception will throw instead.
        parser - Any function-pointer to a function that will transform / convert a java.lang.String into a java.lang.Float.

        NOTE: This parameter may be null, and if it is, the standard Java invocation of Float.parseFloat(String.trim()) is used.
        Returns:
        If the JsonObject property contained a JsonString, and that string was successfully parsed to a java.lang.Float, then it is returned.
        If there were errors attempting to transform the String object-property, and the user-provided flags specified that defaultValue be returned, then that is returned. Null is returned if the flags specified it on error.

        If flags has been passed a '0', and an error-case has arisen, then the relevant exception will throw, instead.
        Throws:
        JsonPropMissingException - If 'jo' does not have a property with the name 'propertyName' and none of these Exception-Flags are set:
        JsonArithmeticObjException - If the number converstion function throws an ArithmeticException while attempting to convert the JsonString into a java.lang.Float, and none of these Exception-Flags are set:
        JsonStrParseObjException - If the JsonObject property specified by 'propertyName' throws an exception while attempting to parse the java.lang.String into a java.lang.Float, and none of these Exception-Flags are set:
        JsonNullObjException - If the JsonObject property specified by 'propertyName' contains Json-Null, rather than a JsonString, and none of these Exception-Flags are set:
        JsonTypeObjException - If the JsonObject property specified by 'propertyName' contains a some other Json-Type rather than JsonString, and none of these Exception-Flags are set:
        See Also:
        RJInternal.PARSE(JsonObject, String, int, Number, Class, Function, Function, Function)
        Code:
        Exact Method Body:
         return PARSE(
             jo, propertyName, FLAGS, defaultValue, Float.class, parser,
             RJInternal::FLOAT_WITH_CHECK, BigDecimal::floatValue
         );
        
      • getBoolean

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Boolean getBoolean​(JsonArray ja,
                                                   int index)
        Retrieve a JsonArray element, and transform it to a java.lang.Boolean. If Json-Null is found - then Java-Null is returned.

        Boxed Java Null's:
        This method facilitates translating a Json-Null into a Java-Null since a Java Boxed-Type number is returned from this method, rather than a Java Primitive
        Parameters:
        ja - Any instance of JsonArray
        index - A valid index into array parameter 'ja'. In Json (and unlike Java), array element types are not actually checked for consistency - meaning an array may hold many different types! This array-index must contain a JSON-BOOLEAN
        Returns:
        An instance of Java-Type java.lang.Boolean, if and only if the array element located at 'index' uses the appropriate Json-Type - JSON-BOOLEAN. If that array-index contains some other type, or that JSON-BOOLEAN cannot be properly transformed to a java.lang.Boolean, then an exception will throw.

        If the specified array-element inside 'ja' has been set to Json-Null, then Java-Null is returned.
        Throws:
        java.lang.IndexOutOfBoundsException - If 'index' is out of the bounds of 'ja'
        JsonTypeArrException - If the array-element (specified by 'index') does not actually contain a JSON-BOOLEAN (but rather, some other non-null Json-Type), then this exception throws.
        See Also:
        JsonValue.getValueType(), JsonValue.ValueType.TRUE, JsonValue.ValueType.FALSE, JsonValue.TRUE, JsonValue.FALSE
        Code:
        Exact Method Body:
         // This will throw an IndexOutOfBoundsException if the index is out of bounds.
         JsonValue jv = ja.get(index);
        
         switch (jv.getValueType())
         {
             // This method 'getBoolean' allows for null-returns.  If Json-Null, return Java-Null.
             case NULL: return null;
        
             // AGAIN: "Type-Mapping" or "Type-Translating" really isn't rocket-science
             case TRUE:  return true;
             case FALSE: return false;
        
             // The JsonValue at the specified array-index does not contain one of the two
             // Json-Boolean Types.  Throw an exception.
        
             default: throw new JsonTypeArrException(ja, index, TRUE, jv, Boolean.class);
         }
        
      • getBoolean

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Boolean getBoolean​(JsonArray ja,
                                                   int index,
                                                   int FLAGS,
                                                   boolean defaultValue)
        Retrieve a JsonArray element, and transform it to a java.lang.Boolean. If Json-Null is found - then Java-Null is returned.

        Boxed Java Null's:
        This method facilitates translating a Json-Null into a Java-Null since a Java Boxed-Type number is returned from this method, rather than a Java Primitive
        Parameters:
        ja - Any instance of JsonArray
        index - A valid index into array parameter 'ja'. In Json (and unlike Java), array element types are not actually checked for consistency - meaning an array may hold many different types! This array-index must contain a JSON-BOOLEAN
        FLAGS - Return-value / exception-throw constants defined in JFlag
        defaultValue - This is the 'Default Value' returned by this method, if there are any exception or problems converting or extracting the specified number.

        The default value is only returned by this method if the appropriate JSON Exception Flag has been passed to the 'FLAGS' parameter! Specifically, if 'FLAGS' were passed '0', then this parameter is fully-irrelevant and ignored. The exception flags are listed in inner-class JFlags

        AGAIN: If an exception-case is encountered, but the exception-flag for that exception has not been set, then this default-value won't be returned, and that exception will throw instead.
        Returns:
        If the JsonArray index contained a number, and that number was successfully transformed to a java.lang.Boolean, then it is returned.

        If there were errors attempting to transform the array-element, but the user-provided flags have specified that the defaultValue be returned, then that is returned. Null is returned if the flags have specified a null-return on error.

        If flags has been passed a '0', and an error-case has arisen, then, instead, the relevant exception will throw.
        Throws:
        java.lang.IndexOutOfBoundsException - If 'index' is out of the bounds of input array 'ja' and none of these Exception-Flags are set:
        JsonNullArrException - If the JsonObject property specified by 'propertyName' contains Json-Null, rather than a JSON-BOOLEAN, and none of these Exception-Flags are set:
        JsonTypeArrException - If the JsonObject property specified by 'propertyName' contains a some other Json-Type rather than JSON-BOOLEAN, and none of these Exception-Flags are set:
        See Also:
        JsonValue.getValueType(), JsonValue.ValueType.TRUE, JsonValue.ValueType.FALSE, JsonValue.TRUE, JsonValue.FALSE
        Code:
        Exact Method Body:
         // When TRUE, the index provided turned out to be outside of the bounds of the array.  The
         // IndexOutOfBounds "handler" (the method called here) will check the FLAGS, and:
         //
         //  1) return the defaultValue (if Requested by 'FLAGS' for IOOBEX)
         //  2) return null (if Requested by 'FLAGS' for IOOBEX)
         //  3) throw IndexOutOfBoundsException
        
         if (index >= ja.size()) return IOOBEX(ja, index, defaultValue, FLAGS);
        
         JsonValue jv = ja.get(index); // Throw an IndexOutOfBoundsException
        
         switch (jv.getValueType())
         {
             // When a 'NULL' (Json-Null) JsonValue is present, the JsonNullArrException 'handler'
             // will do one of the following:
             //
             //  1) return the defaultValue (if Requested by 'FLAGS' for JNAEX)
             //  2) return null (if Requested by 'FLAGS' for JNAEX)
             //  3) throw JsonNullArrException
        
             case NULL: return JNAEX(ja, index, defaultValue, FLAGS, TRUE, Boolean.class);
        
             // AGAIN: "Type-Mapping" or "Type-Translating" really isn't rocket-science
             case TRUE:  return true;
             case FALSE: return false;
        
             // The JsonValue at the specified array-index does not contain one of the two
             // Json-Boolean Types.  The "JsonTypeArrException Handler" will do one of these:
             //
             //  1) return the defaultValue (if Requested by 'FLAGS' for JTAEX)
             //  2) return null (if Requested by 'FLAGS' for JTAEX)
             //  3) throw JsonTypeArrException
        
             default: return JTAEX(ja, index, defaultValue, FLAGS, TRUE, jv, Boolean.class);
         }
        
      • parseBoolean

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Boolean parseBoolean​
                    (JsonArray ja,
                     int index,
                     int FLAGS,
                     boolean defaultValue,
                     java.util.function.Function<java.lang.String,​java.lang.Boolean> optionalParser)
        
        Retrieve a JsonArray element containing a JsonString, and transform it to a java.lang.Boolean, with either a user-provided parser, or the standard java boolean parser
        Parameters:
        ja - Any instance of JsonArray
        index - The array index containing the JsonString element to retrieve.
        FLAGS - Return-value / exception-throw constants defined in JFlag
        defaultValue - This is the 'Default Value' returned by this method, if there are any exception or problems converting or extracting the specified number.

        The default value is only returned by this method if the appropriate JSON Exception Flag has been passed to the 'FLAGS' parameter! Specifically, if 'FLAGS' were passed '0', then this parameter is fully-irrelevant and ignored. The exception flags are listed in inner-class JFlags

        AGAIN: If an exception-case is encountered, but the exception-flag for that exception has not been set, then this default-value won't be returned, and that exception will throw instead.
        optionalParser - Any function-pointer to a function that will transform / convert a java.lang.String into a java.lang.Boolean.

        NOTE: This parameter may be null, and if it is, the standard Java invocation of Boolean.parseBoolean(String.trim()) is used.
        Returns:
        If the JsonArray index contained a JsonString, and that string was successfully parsed to a java.lang.Boolean, then it is returned.
        If there were errors attempting to transform the String array-element, and the user-provided flags specified that defaultValue be returned, then that is returned. Null is returned if the flags specified it on error.

        If flags has been passed a '0', and an error-case has arisen, then the relevant exception will throw, instead.
        Throws:
        java.lang.IndexOutOfBoundsException - If 'index' is out of the bounds of input array 'ja' and none of these Exception-Flags are set:
        JsonStrParseArrException - If the JsonArray element located at 'index' throws an exception while attempting to parse the java.lang.String into a java.lang.Boolean, and none of these Exception-Flags are set:
        JsonNullArrException - If the JsonArray element located at 'index' contains Json-Null, rather than a JsonString, and none of these Exception-Flags are set:
        JsonTypeArrException - If the JsonArray element located at 'index' contains a some other Json-Type rather than JsonString, and none of these Exception-Flags are set:
        Code:
        Exact Method Body:
         // When TRUE, the index provided turned out to be outside of the bounds of the array.  The
         // IndexOutOfBounds "handler" (the method called here) will check the FLAGS, and:
         //
         //  1) return the defaultValue (if Requested by 'FLAGS' for IOOBEX)
         //  2) return null (if Requested by 'FLAGS' for IOOBEX)
         //  3) throw IndexOutOfBoundsException
        
         if (index >= ja.size()) return IOOBEX(ja, index, defaultValue, FLAGS);
        
         JsonValue jv = ja.get(index);
        
         switch (jv.getValueType())
         {
             // When a 'NULL' (Json-Null) JsonValue is present, the JsonNullArrException 'handler'
             // will do one of the following:
             //
             //  1) return the defaultValue (if Requested by 'FLAGS' for JNAEX)
             //  2) return null (if Requested by 'FLAGS' for JNAEX)
             //  3) throw JsonNullArrException
        
             case NULL: return JNAEX(ja, index, defaultValue, FLAGS, STRING, Boolean.class);
        
             case STRING:
        
                 String s = ((JsonString) jv).getString();
        
                 // NOTE: This isn't actually an "Exception Case", and if the user hasn't made
                 //       a request, the empty-string is passed to whatever parser is configured
        
                 if (s.length() == 0)
                 {
                     if ((FLAGS & RETURN_NULL_ON_0LEN_STR) != 0)     return null;
                     if ((FLAGS & RETURN_DEFVAL_ON_0LEN_STR) != 0)   return defaultValue;
                     if ((FLAGS & RETURN_NULL_ON_ANY_ALL) != 0)      return null;
                     if ((FLAGS & RETURN_DEFVAL_ON_ANY_ALL) != 0)    return defaultValue;
                 }
        
                 try
                 {
                     return (optionalParser != null)
                         ? optionalParser.apply(s)
                         : Boolean.parseBoolean(s.trim());
                 }
        
                 // HANDLER STRIKES AGAIN! - but this time for "JsonStrParseArrException"
                 // RETURNS: null, or defaultValue, (otherwise throws JsonStrParseArrException)
        
                 catch (Exception e)
                     { return JSPAEX(e, ja, index, defaultValue, FLAGS, jv, Boolean.class); }
        
             // The JsonValue at the specified array-index does not contain an JsonString.
             // The "JsonTypeArrException Handler" will do one of these:
             //
             //  1) return the defaultValue (if Requested by 'FLAGS' for JTAEX)
             //  2) return null (if Requested by 'FLAGS' for JTAEX)
             //  3) throw JsonTypeArrException
        
             default: return JTAEX(ja, index, defaultValue, FLAGS, STRING, jv, Boolean.class);
         }
        
      • getBoolean

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Boolean getBoolean​(JsonObject jo,
                                                   java.lang.String propertyName,
                                                   boolean isOptional)
        Extract a JsonObject property, and transform it to a java.lang.Boolean. If Json-Null is found - then Java-Null is returned.

        Boxed Java Null's:
        This method facilitates translating a Json-Null into a Java-Null since a Java Boxed-Type number is returned from this method, rather than a Java Primitive
        Parameters:
        jo - Any instance of JsonObject.
        propertyName - The name of the JSON property that should be contained within 'jo'. This property will be retrieved and subsequently transformed / converted to Java-Type java.lang.Boolean.
        isOptional - When TRUE is passed, if 'propertyName' is not actually listed in 'jo' this method shall return Java-Null gracefully. When FALSE is passed, if 'jo' does not have the specified property, a JsonPropMissingException will throw.

        If 'jo' actually has a property named 'propertyName', then the value passed to this parameter is fully irrelevant.
        Returns:
        An instance of Java-Type java.lang.Boolean, if and only if the 'propertyName' is available inside 'jo', and that property uses the appropriate Json-Type - JSON-BOOLEAN

        If the specified property has been set to 'null' (Json-Null) in the passed JsonObject, then Java-Null is returned. Java-Null is also returned if 'propertyName' is not listed / unavailable in 'jo' and TRUE has been passed to 'isOptional'.

        Other cases shall generate an exception throw.
        Throws:
        JsonPropMissingException - This exception shall throw if the specified property is missing from the 'JsonObject' (parameter 'jo'). This exception throw can be avoided if 'TRUE' is passed to parameter 'isOptional'.
        JsonTypeObjException - If the property (specified by 'propertyName') is extracted, but that property does not actually contain a JSON-BOOLEAN (but rather, some other non-null Json-Type), then this exception throws.
        See Also:
        JsonValue.getValueType(), JsonValue.ValueType.TRUE, JsonValue.ValueType.FALSE, JsonValue.TRUE, JsonValue.FALSE
        Code:
        Exact Method Body:
         if (! jo.containsKey(propertyName))
         {
             if (isOptional) return null;
        
             throw new JsonPropMissingException(jo, propertyName, TRUE, Boolean.class);
         }
        
         JsonValue jv = jo.get(propertyName);
        
         switch (jv.getValueType())
         {
             // This method 'getBoolean' allows for null-returns.  If Json-Null, return Java-Null.
             case NULL: return null;
        
             // AGAIN: "Type-Mapping" or "Type-Translating" really isn't rocket-science
             case TRUE:  return true;
             case FALSE: return false;
        
             // The JsonValue at the specified array-index does not contain one of the two
             // Json-Boolean Types.  Throw an exception.
        
             default: throw new JsonTypeObjException
                 (jo, propertyName, TRUE, jv, Boolean.class);
         }
        
      • getBoolean

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Boolean getBoolean​(JsonObject jo,
                                                   java.lang.String propertyName,
                                                   int FLAGS,
                                                   boolean defaultValue)
        Retrieve a JsonObject property, and transform it to a java.lang.Boolean. If Json-Null is found - then Java-Null is returned.

        Boxed Java Null's:
        This method facilitates translating a Json-Null into a Java-Null since a Java Boxed-Type number is returned from this method, rather than a Java Primitive
        Parameters:
        jo - Any instance of JsonObject
        propertyName - The name of the JSON property that should be contained within 'jo'. This property will be retrieved and subsequently transformed / converted to Java-Type java.lang.Boolean.
        FLAGS - Return-value / exception-throw constants defined in JFlag
        defaultValue - This is the 'Default Value' returned by this method, if there are any exception or problems converting or extracting the specified number.

        The default value is only returned by this method if the appropriate JSON Exception Flag has been passed to the 'FLAGS' parameter! Specifically, if 'FLAGS' were passed '0', then this parameter is fully-irrelevant and ignored. The exception flags are listed in inner-class JFlags

        AGAIN: If an exception-case is encountered, but the exception-flag for that exception has not been set, then this default-value won't be returned, and that exception will throw instead.
        Returns:
        If the JsonObject property contained a number, and that number was successfully transformed to a java.lang.Boolean, then it is returned.

        If there were errors attempting to transform the object-property, and the user-provided flags have specified that the defaultValue be returned, then that is returned. Null is returned if the flags have specified a null-return on error.

        If flags has been passed a '0', and an error-case has arisen, then, instead, the relevant exception will throw.
        Throws:
        JsonPropMissingException - If 'jo' does not have a property with the name 'propertyName' and none of these Exception-Flags are set:
        JsonNullObjException - If the JsonObject property specified by 'propertyName' contains Json-Null, rather than a JSON-BOOLEAN, and none of these Exception-Flags are set:
        JsonTypeObjException - If the JsonObject property specified by 'propertyName' contains a some other Json-Type rather than JSON-BOOLEAN, and none of these Exception-Flags are set:
        See Also:
        JsonValue.getValueType(), JsonValue.ValueType.TRUE, JsonValue.ValueType.FALSE, JsonValue.TRUE, JsonValue.FALSE
        Code:
        Exact Method Body:
         JsonValue jv = jo.get(propertyName);
        
         // When TRUE, the user-specified 'property' (named by 'propertyName') isn't actually one
         // of the listed properties inside the JsonObject.  The JsonPropMissingException "handler"
         // (the method called here) will check the FLAGS, and:
         //
         //  1) return the defaultValue (if Requested by 'FLAGS' for JPMEX)
         //  2) return null (if Requested by 'FLAGS' for JPMEX)
         //  3) throw JsonPropMissingException
        
         if (jv == null) return JPMEX(jo, propertyName, defaultValue, FLAGS, TRUE, Boolean.class);
        
         switch (jv.getValueType())
         {
             // When a 'NULL' (Json-Null) JsonValue is present, the JsonNullObjException 'handler'
             // will do one of the following:
             //
             //  1) return the defaultValue (if Requested by 'FLAGS' for JNOEX)
             //  2) return null (if Requested by 'FLAGS' for JNOEX)
             //  3) throw JsonNullArrException
        
             case NULL: return JNOEX(jo, propertyName, defaultValue, FLAGS, TRUE, Boolean.class);
        
             // AGAIN: "Type-Mapping" or "Type-Translating" really isn't rocket-science
             case TRUE:  return true;
             case FALSE: return false;
        
             // The property contains a JsonValue that is not one of the two
             // Json-Boolean Types.  Throw an exception.
        
             // The JsonValue of 'propertyName' does not contain an JsonString.
             // The "JsonTypeObjException Handler" will do one of these:
             //
             //  1) return the defaultValue (if Requested by 'FLAGS' for JTOEX)
             //  2) return null (if Requested by 'FLAGS' for JTOEX)
             //  3) throw JsonTypeObjException
        
             default: return JTOEX(jo, propertyName, defaultValue, FLAGS, TRUE, jv, Boolean.class);
         }
        
      • parseBoolean

        🡅     🗕  🗗  🗖
        public static java.lang.Boolean parseBoolean​
                    (JsonObject jo,
                     java.lang.String propertyName,
                     int FLAGS,
                     boolean defaultValue,
                     java.util.function.Function<java.lang.String,​java.lang.Boolean> parser)
        
        Retrieve a JsonObject property containing a JsonString, and transform it to a java.lang.Boolean, with either a user-provided parser, or the standard java boolean parser
        Parameters:
        jo - Any instance of JsonObject
        propertyName - The name of the JSON property that should be contained within 'jo'. This property will be retrieved and subsequently transformed / converted to Java-Type java.lang.Float.
        FLAGS - Return-value / exception-throw constants defined in JFlag
        defaultValue - This is the 'Default Value' returned by this method, if there are any exception or problems converting or extracting the specified number.

        The default value is only returned by this method if the appropriate JSON Exception Flag has been passed to the 'FLAGS' parameter! Specifically, if 'FLAGS' were passed '0', then this parameter is fully-irrelevant and ignored. The exception flags are listed in inner-class JFlags

        AGAIN: If an exception-case is encountered, but the exception-flag for that exception has not been set, then this default-value won't be returned, and that exception will throw instead.
        parser - Any function-pointer to a function that will transform / convert a java.lang.String into a java.lang.Float.

        NOTE: This parameter may be null, and if it is, the standard Java invocation of Float.parseFloat(String.trim()) is used.
        Returns:
        If the JsonObject property contained a JsonString, and that string was successfully parsed to a java.lang.Float, then it is returned.
        If there were errors attempting to transform the String object-property, and the user-provided flags specified that defaultValue be returned, then that is returned. Null is returned if the flags specified it on error.

        If flags has been passed a '0', and an error-case has arisen, then the relevant exception will throw, instead.
        Throws:
        java.lang.IndexOutOfBoundsException - If 'index' is out of the bounds of input array 'ja' and none of these Exception-Flags are set:
        JsonStrParseObjException - If the JsonObject property specified by 'propertyName' throws an exception while attempting to parse the java.lang.String into a java.lang.Float, and none of these Exception-Flags are set:
        JsonNullObjException - If the JsonObject property specified by 'propertyName' contains Json-Null, rather than a JsonString, and none of these Exception-Flags are set:
        JsonTypeObjException - If the JsonObject property specified by 'propertyName' contains a some other Json-Type rather than JsonString, and none of these Exception-Flags are set:
        Code:
        Exact Method Body:
         JsonValue jv = jo.get(propertyName);
        
         // When TRUE, the user-specified 'property' (named by 'propertyName') isn't actually one
         // of the listed properties inside the JsonObject.  The JsonPropMissingException "handler"
         // (the method called here) will check the FLAGS, and:
         //
         //  1) return the defaultValue (if Requested by 'FLAGS' for JPMEX)
         //  2) return null (if Requested by 'FLAGS' for JPMEX)
         //  3) throw JsonPropMissingException
        
         if (jv == null) return JPMEX(jo, propertyName, defaultValue, FLAGS, STRING, Boolean.class);
        
         switch (jv.getValueType())
         {
             // When a 'NULL' (Json-Null) JsonValue is present, the JsonNullObjException 'handler'
             // will do one of the following:
             //
             //  1) return the defaultValue (if Requested by 'FLAGS' for JNOEX)
             //  2) return null (if Requested by 'FLAGS' for JNOEX)
             //  3) throw JsonNullArrException
        
             case NULL: return JNOEX(jo, propertyName, defaultValue, FLAGS, STRING, Boolean.class);
        
             case STRING:
        
                 String s = ((JsonString) jv).getString();
        
                 // NOTE: This isn't actually an "Exception Case", and if the user hasn't made
                 //       a request, the empty-string is passed to whatever parser is configured
        
                 if (s.length() == 0)
                 {
                     if ((FLAGS & RETURN_NULL_ON_0LEN_STR) != 0)     return null;
                     if ((FLAGS & RETURN_DEFVAL_ON_0LEN_STR) != 0)   return defaultValue;
                     if ((FLAGS & RETURN_NULL_ON_ANY_ALL) != 0)      return null;
                     if ((FLAGS & RETURN_DEFVAL_ON_ANY_ALL) != 0)    return defaultValue;
                 }
        
                 try
                     { return (parser != null) ? parser.apply(s) : Boolean.parseBoolean(s.trim()); }
        
                 // HANDLER STRIKES AGAIN! - but this time for "JsonStrParseObjException"
                 // RETURNS: null, or defaultValue, (otherwise throws JsonStrParseObjException)
        
                 catch (Exception e)
                     { return JSPOEX(e, jo, propertyName, defaultValue, FLAGS, jv, Boolean.class); }
        
             // The JsonValue of 'propertyName' does not contain an JsonString.
             // The "JsonTypeObjException Handler" will do one of these:
             //
             //  1) return the defaultValue (if Requested by 'FLAGS' for JTOEX)
             //  2) return null (if Requested by 'FLAGS' for JTOEX)
             //  3) throw JsonTypeObjException
        
             default: return JTOEX(jo, propertyName, defaultValue, FLAGS, STRING, jv, Boolean.class);
         }