Package Torello.JSON
Class RJArrIntoPrimConsumer
- java.lang.Object
-
- Torello.JSON.RJArrIntoPrimConsumer
-
public class RJArrIntoPrimConsumer extends java.lang.Object
RJArrIntoPrimConsumer 🠞RJArr- ReadJsonArray
This class is used for reading data directly from an already parsedJsonArrayinstance.
Into- Data that is extracted, is sent to a specific User-Provided Destination.
PrimConsumer- Data is sent to a Java Primitive-Consumer.
Utilities for parsing Json Array's and sending the parsed values into a Java Consumer of Boxed-Primitives.
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 Glass Fish Tool is included in the J2EE, and is available on GitHub. That is the one used by the Java HTML JAR Library (See:javax.json.*)
Primary Classes Used:JsonArrayandJsonObject
This comment-note is intentionally repeated, verbatim, at the top of all Json Reader Classes in this package.
JSON to Java Binding:
JSON-Binding is the art of converting data that has been stored, saved or transmitted usingJava-Script Object Notationinto a Java Primitive or Object-Type.JSONcan arrive into Java-Program Memory from almost any source. If you are wondering why such a massive amount of "work" is necessary just to convert a Json Integer into Java Integer, the value added is the extraordinary amount of attention paid to user configuration, error checking, & exception messaging. Methods here don't require more than 1 or 2 lines of code, and guarantee that a thorough type checking is performed.
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 may or may not be assured. The methods here are able to handle changes that might be made to an API (possibly from great distances away, and without the Software-Manager's consent). If an error could occur, configuration flags can be used to determine default error-recovery behaviors. If an exception does throw, the exception messages printed will contain multiple lines of detailed information.- 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. Json Files can occasionally grow extremely large, and error messaging details make debugging easier
- Primary Helper-Classes for the (Experimental) Google-Chrome
Browser AutomationPackage
The goal ofTorello.JSONis to provide small, static helper methods in the same spirit asjava.util.Objectsandjava.util.Arrays: simple calls that keep JSON handling out of your application logic. Instead of repeating loops, type checks, null checks, and exception wiring at every call site, these methods centralize that work behind a consistent set of straight-forward “read value” operations.
Extract Elements from a JsonArray, and transmit them to Java Primitive-Type Consumer's
Each of the methods in this class, all declared'static', accept a standardJsonArrayas input, and make a (User-Specified) "Best Efforts" attempt to convert each of the elements of the array into Java-Primitives. Each Json-Array Element that is successfully converted into a primitive is subsequently passed to a (User-Provided) Java-Consumer.
This class is capable of processing 7 of the 8 Java-Primitives that the language makes available. The'char'type is not accomodated by the Array-Processing Classes in this Json-Package. For each method in this class, the user is expected to provide a singleJsonArrayas input, along with one of the appropriate & matching Java Primitive-Consumer. For thePrimitive-Consumer'swhich aren't actually provided by the packagejava.util.function, the ones within packageTorello.Java.Functionshould be supplied, instead.
Method Parameters
Parameter Explanation jaThis may be any parsed JsonArraywhose contents are consistent with the Input-Parameters to the User-Provided Consumer'c'.defaultValueWhen an appropriate JFlag-Value is included in the mask, this Default-Value will be passed to the User-Provided Consumer in whichever Error-Circumstance has occured (as per the Flag-Value Name).
This Default-Value may be requested throughJFlag-Values such as:RD_AEX,RD_IOBandRD_M(among others). The'RD'in these Flag's Names is an abbreviation for "Return Default-Value".
The Complete List of Flags which request that this Default-Value Parameter be employed under various Error-Circumstances may be viewed in the following link. The name of each of these flags attempts identify the type of Error-Situation to which it may be applied.
Default-Value FlagsFLAGSA Bit-Wise Flag-Mask that provides a means for configuring the Array-Processing Logic to properly handle several types of Error-Cases & potentatial, unexpected, array contents.
A Flag-Mask of'0'requests that any Error-Situations which occur, should they crop up while processing the array, be handled by standard means - meaning by throwing one of the germaine Exception-Classes.optionalUserParserThis parameter can only serve a purpose when it is used in conjunction with a JFlag-Vaule which explicity requests that JavaString-Values be handled by a parser (rather than causing an exception to throw).
The two flags which may be employed to signal this Handler-Behavior are:RETURN_PARSE_ON_STRandRP_S(the latter being merely the abbreviated variant of the former).
If neither of these flags have been AND'ed into the Flag-Mask parameter ("FLAGS"), then any function which is passed to this parameter ("optionalUserParser") is wholly ignored - simply because using aString-Parser is not a "Default Behavior of this class' Array-Processing Logic.<PRIMITIVE> Consumer cThis is the Output-Target to which all retrieved values from the User-Provided JsonArrayare sent.IntInt-<PRIMITIVE> Consumer c
The other Consumer-Type which may be provided as input to this class, has a Method-Sigature which also accepts two extra integers. The two extraint-Parameters are aJsonArray-Index, and also an additional'count'.
The value of integer'count'is the number of times the returned consumer has been provided a value.
Note that there are certain Error-Cases in which a user may request that the contents of an Array-Index be skipped (viaJFlag-Value), rather than force an exception throw. This, hopefully, explains why the'count'may may, from time to time, be different from the Input Array-Index (although, in most scenarios the Array-Indexintand the Countintwill be identical).
Hi-Lited Source-Code:This File's Source Code:
- View Here: Torello/JSON/RJArrIntoPrimConsumer.java
- Open New Browser-Tab: Torello/JSON/RJArrIntoPrimConsumer.java
File Size: 20,197 Bytes Line Count: 524 '\n' Characters Found
Internal Use Only: Settings-Record Helper:
- View Here: BASIC_TYPES.java
- Open New Browser-Tab: BASIC_TYPES.java
File Size: 28,899 Bytes Line Count: 621 '\n' Characters Found
Internal Use Only: Settings-Record Helper:
- View Here: SETTINGS_REC_BUILDER.java
- Open New Browser-Tab: SETTINGS_REC_BUILDER.java
File Size: 9,477 Bytes Line Count: 218 '\n' Characters Found
Stateless Class:This class neither contains any program-state, nor can it be instantiated. The@StaticFunctionalAnnotation may also be called 'The Spaghetti Report'.Static-Functionalclasses are, essentially, C-Styled Files, without any constructors or non-static member fields. It is a concept very similar to the Java-Bean's@StatelessAnnotation.
- 1 Constructor(s), 1 declared private, zero-argument constructor
- 14 Method(s), 14 declared static
- 0 Field(s)
-
-
Method Summary
Read the Contents of a JsonArrayinto a Java Primitive-ConsumerModifier and Type Method static voidbooleanArr(JsonArray ja, boolean defaultValue, int FLAGS, Predicate<String> optionalUserParser, BoolConsumer c)static voidbyteArr(JsonArray ja, byte defaultValue, int FLAGS, ToByteFunction<String> optionalUserParser, ByteConsumer c)static voiddoubleArr(JsonArray ja, double defaultValue, int FLAGS, ToDoubleFunction<String> optionalUserParser, DoubleConsumer c)static voidfloatArr(JsonArray ja, float defaultValue, int FLAGS, ToFloatFunction<String> optionalUserParser, FloatConsumer c)static voidintArr(JsonArray ja, int defaultValue, int FLAGS, ToIntFunction<String> optionalUserParser, IntConsumer c)static voidlongArr(JsonArray ja, long defaultValue, int FLAGS, ToLongFunction<String> optionalUserParser, LongConsumer c)static voidshortArr(JsonArray ja, short defaultValue, int FLAGS, ToShortFunction<String> optionalUserParser, ShortConsumer c)Read the Contents of a JsonArrayinto a Primitive-Consumer, w/ Array-IndicesModifier and Type Method static voidbooleanArr2(JsonArray ja, boolean defaultValue, int FLAGS, Predicate<String> optionalUserParser, IntIntBoolCons c)static voidbyteArr2(JsonArray ja, byte defaultValue, int FLAGS, ToByteFunction<String> optionalUserParser, IntIntByteCons c)static voiddoubleArr2(JsonArray ja, double defaultValue, int FLAGS, ToDoubleFunction<String> optionalUserParser, IntIntDoubleCons c)static voidfloatArr2(JsonArray ja, float defaultValue, int FLAGS, ToFloatFunction<String> optionalUserParser, IntIntFloatCons c)static voidintArr2(JsonArray ja, int defaultValue, int FLAGS, ToIntFunction<String> optionalUserParser, TriIntCons c)static voidlongArr2(JsonArray ja, long defaultValue, int FLAGS, ToLongFunction<String> optionalUserParser, IntIntLongCons c)static voidshortArr2(JsonArray ja, short defaultValue, int FLAGS, ToShortFunction<String> optionalUserParser, IntIntShortCons c)
-
-
-
Method Detail
-
intArr
public static void intArr (JsonArray ja, int defaultValue, int FLAGS, java.util.function.ToIntFunction<java.lang.String> optionalUserParser, java.util.function.IntConsumer c)
Java-Consumer which accepts Primitive-IntegersInvokes: Method ProcessJsonArray.numericToJava(JsonArray, SettingsRec)Passes: Java IntegerSettings-RecordRemoves: Any JFlagmasks which might insert null-entries in the return-streamSee: Class JFlagfor information about parameter'FLAGS'See: Flag JFlag.NOT_ALLOWED_RET_NULL_MASKSfor a list of all disallowed & filtered flags.Lambda-Signature: Like void accept (int value)
Example:
IntConsumer myConsumer = (int primVal) -> System.out.println(primVal); RJArrIntoBoxedConsumer.intArr(ja, -1, 0, null, myConsumer);
- Code:
- Exact Method Body:
Objects.requireNonNull(c, "IntConsumer parameter 'c' is null"); ProcessJsonArray.numericToJava( ja, new SETTINGS_REC_BUILDER<Integer, Void>( defaultValue, FLAGS, (optionalUserParser == null) ? null : optionalUserParser::applyAsInt, BASIC_TYPES.PRIMITIVE_INTEGER() ) .oneArgConsumer(c::accept) );
-
shortArr
public static void shortArr (JsonArray ja, short defaultValue, int FLAGS, ToShortFunction<java.lang.String> optionalUserParser, ShortConsumer c)
Java-Consumer which accepts Primitive Short-IntegersInvokes: Method ProcessJsonArray.numericToJava(JsonArray, SettingsRec)Passes: Java ShortSettings-RecordRemoves: Any JFlagmasks which might insert null-entries in the return-streamSee: Class JFlagfor information about parameter'FLAGS'See: Flag JFlag.NOT_ALLOWED_RET_NULL_MASKSfor a list of all disallowed & filtered flags.Lambda-Signature: Like void accept (short value)
Example:
ShortConsumer myConsumer = (short primVal) -> System.out.println(primVal); RJArrIntoBoxedConsumer.shortArr(ja, -1, 0, null, myConsumer);
- Code:
- Exact Method Body:
Objects.requireNonNull(c, "ShortConsumer parameter 'c' is null"); ProcessJsonArray.numericToJava( ja, new SETTINGS_REC_BUILDER<Short, Void>( defaultValue, FLAGS & NOT_ALLOWED_RET_NULL_MASKS, (optionalUserParser == null) ? null : optionalUserParser::applyAsShort, BASIC_TYPES.PRIMITIVE_SHORT() ) .oneArgConsumer(c::accept) );
-
byteArr
public static void byteArr (JsonArray ja, byte defaultValue, int FLAGS, ToByteFunction<java.lang.String> optionalUserParser, ByteConsumer c)
Java-Consumer which accepts Primitive-BytesInvokes: Method ProcessJsonArray.numericToJava(JsonArray, SettingsRec)Passes: Java ByteSettings-RecordRemoves: Any JFlagmasks which might insert null-entries in the return-streamSee: Class JFlagfor information about parameter'FLAGS'See: Flag JFlag.NOT_ALLOWED_RET_NULL_MASKSfor a list of all disallowed & filtered flags.Lambda-Signature: Like void accept (byte value)
Example:
ByteConsumer myConsumer = (byte primVal) -> System.out.println(primVal); RJArrIntoBoxedConsumer.byteArr(ja, -1, 0, null, myConsumer);
- Code:
- Exact Method Body:
Objects.requireNonNull(c, "ByteConsumer parameter 'c' is null"); ProcessJsonArray.numericToJava( ja, new SETTINGS_REC_BUILDER<Byte, Void>( defaultValue, FLAGS & NOT_ALLOWED_RET_NULL_MASKS, (optionalUserParser == null) ? null : optionalUserParser::applyAsByte, BASIC_TYPES.PRIMITIVE_BYTE() ) .oneArgConsumer(c::accept) );
-
longArr
public static void longArr (JsonArray ja, long defaultValue, int FLAGS, java.util.function.ToLongFunction<java.lang.String> optionalUserParser, java.util.function.LongConsumer c)
Java-Consumer which accepts Primitive Long-IntegersInvokes: Method ProcessJsonArray.numericToJava(JsonArray, SettingsRec)Passes: Java LongSettings-RecordRemoves: Any JFlagmasks which might insert null-entries in the return-streamSee: Class JFlagfor information about parameter'FLAGS'See: Flag JFlag.NOT_ALLOWED_RET_NULL_MASKSfor a list of all disallowed & filtered flags.Lambda-Signature: Like void accept (long value)
Example:
LongConsumer myConsumer = (long primVal) -> System.out.println(primVal); RJArrIntoBoxedConsumer.longArr(ja, -1, 0, null, myConsumer);
- Code:
- Exact Method Body:
Objects.requireNonNull(c, "LongConsumer parameter 'c' is null"); ProcessJsonArray.numericToJava( ja, new SETTINGS_REC_BUILDER<Long, Void>( defaultValue, FLAGS & NOT_ALLOWED_RET_NULL_MASKS, (optionalUserParser == null) ? null : optionalUserParser::applyAsLong, BASIC_TYPES.PRIMITIVE_LONG() ) .oneArgConsumer(c::accept) );
-
doubleArr
public static void doubleArr (JsonArray ja, double defaultValue, int FLAGS, java.util.function.ToDoubleFunction<java.lang.String> optionalUserParser, java.util.function.DoubleConsumer c)
Java-Consumer which accepts Primitive-DoublesInvokes: Method ProcessJsonArray.numericToJava(JsonArray, SettingsRec)Passes: Java DoubleSettings-RecordRemoves: Any JFlagmasks which might insert null-entries in the return-streamSee: Class JFlagfor information about parameter'FLAGS'See: Flag JFlag.NOT_ALLOWED_RET_NULL_MASKSfor a list of all disallowed & filtered flags.Lambda-Signature: Like void accept (double value)
Example:
DoubleConsumer myConsumer = (double primVal) -> System.out.println(primVal); RJArrIntoBoxedConsumer.doubleArr(ja, -1, 0, null, myConsumer);
- Code:
- Exact Method Body:
Objects.requireNonNull(c, "DoubleConsumer parameter 'c' is null"); ProcessJsonArray.numericToJava( ja, new SETTINGS_REC_BUILDER<Double, Void>( defaultValue, FLAGS & NOT_ALLOWED_RET_NULL_MASKS, (optionalUserParser == null) ? null : optionalUserParser::applyAsDouble, BASIC_TYPES.PRIMITIVE_DOUBLE() ) .oneArgConsumer(c::accept) );
-
floatArr
public static void floatArr (JsonArray ja, float defaultValue, int FLAGS, ToFloatFunction<java.lang.String> optionalUserParser, FloatConsumer c)
Java-Consumer which accepts Primitive-FloatsInvokes: Method ProcessJsonArray.numericToJava(JsonArray, SettingsRec)Passes: Java FloatSettings-RecordRemoves: Any JFlagmasks which might insert null-entries in the return-streamSee: Class JFlagfor information about parameter'FLAGS'See: Flag JFlag.NOT_ALLOWED_RET_NULL_MASKSfor a list of all disallowed & filtered flags.Lambda-Signature: Like void accept (float value)
Example:
FloatConsumer myConsumer = (float primVal) -> System.out.println(primVal); RJArrIntoBoxedConsumer.floatArr(ja, -1, 0, null, myConsumer);
- Code:
- Exact Method Body:
Objects.requireNonNull(c, "FloatConsumer parameter 'c' is null"); ProcessJsonArray.numericToJava( ja, new SETTINGS_REC_BUILDER<Float, Void>( defaultValue, FLAGS & NOT_ALLOWED_RET_NULL_MASKS, (optionalUserParser == null) ? null : optionalUserParser::applyAsFloat, BASIC_TYPES.PRIMITIVE_FLOAT() ) .oneArgConsumer(c::accept) );
-
booleanArr
public static void booleanArr (JsonArray ja, boolean defaultValue, int FLAGS, java.util.function.Predicate<java.lang.String> optionalUserParser, BoolConsumer c)
Java-Consumer which accepts Primitive-BooleansInvokes: Method ProcessJsonArray.booleanToJava(JsonArray, SettingsRec)Passes: Java BooleanSettings-RecordRemoves: Any JFlagmasks which might insert null-entries in the return-streamSee: Class JFlagfor information about parameter'FLAGS'See: Flag JFlag.NOT_ALLOWED_RET_NULL_MASKSfor a list of all disallowed & filtered flags.Lambda-Signature: Like void accept (boolean value)
Example:
BoolConsumer myConsumer = (boolean primVal) -> System.out.println(primVal); RJArrIntoBoxedConsumer.booleanArr(ja, -1, 0, null, myConsumer);
- Code:
- Exact Method Body:
Objects.requireNonNull(c, "BoolConsumer parameter 'c' is null"); ProcessJsonArray.booleanToJava( ja, new SETTINGS_REC_BUILDER<Boolean, Void>( defaultValue, FLAGS & NOT_ALLOWED_RET_NULL_MASKS, (optionalUserParser == null) ? null : optionalUserParser::test, BASIC_TYPES.PRIMITIVE_BOOLEAN() ) .oneArgConsumer(c::accept) );
-
intArr2
public static void intArr2 (JsonArray ja, int defaultValue, int FLAGS, java.util.function.ToIntFunction<java.lang.String> optionalUserParser, TriIntCons c)
Java-Consumer which accepts Primitive-Integers & Array-IndicesInvokes: ProcessJsonArray.numericToJava(JsonArray, SettingsRec)Passes: Java IntegerSettings-Record, w/ an "Array-Indices & Count Consumer"Removes: Any JFlagmasks which might insert null-entries in the return-streamSee: Class JFlagfor information about parameter'FLAGS'See: Flag JFlag.NOT_ALLOWED_RET_NULL_MASKSfor a list of all disallowed & filtered flags.Input-Consumer: Interface TriIntConsLambda-Signature: (Functional Interface) void accept (int jsonArrIndex, int acceptCount, int value)
Example:
TriIntCons myConsumer = (int i1, int i2, int primVal) -> System.out.println("jsonArr[" + i1 + "], acceptCount[" + i2 + "]: " + primVal); RJArrIntoBoxedConsumer.intArr2(ja, -1, 0, null, myConsumer);
- Code:
- Exact Method Body:
Objects.requireNonNull(c, "TriIntCons parameter 'c' is null"); ProcessJsonArray.numericToJava( ja, new SETTINGS_REC_BUILDER<Integer, Void>( defaultValue, FLAGS, (optionalUserParser == null) ? null : optionalUserParser::applyAsInt, BASIC_TYPES.PRIMITIVE_INTEGER() ) .threeArgConsumer(c::accept) );
-
shortArr2
public static void shortArr2 (JsonArray ja, short defaultValue, int FLAGS, ToShortFunction<java.lang.String> optionalUserParser, IntIntShortCons c)
Java-Consumer which accepts Primitive Short-Integers & Array-IndicesInvokes: Method ProcessJsonArray.numericToJava(JsonArray, SettingsRec)Passes: Java ShortSettings-Record, w/ an "Array-Indices & Count Consumer"Removes: Any JFlagmasks which might insert null-entries in the return-streamSee: Class JFlagfor information about parameter'FLAGS'See: Flag JFlag.NOT_ALLOWED_RET_NULL_MASKSfor a list of all disallowed & filtered flags.Input-Consumer: Interface IntIntShortConsLambda-Signature: (Functional Interface) void accept (int jsonArrIndex, int acceptCount, short value)
Example:
IntIntShortCons myConsumer = (int i1, int i2, short primVal) -> System.out.println("jsonArr[" + i1 + "], acceptCount[" + i2 + "]: " + primVal); RJArrIntoBoxedConsumer.shortArr2(ja, -1, 0, null, myConsumer);
- Code:
- Exact Method Body:
Objects.requireNonNull(c, "IntIntShortCons parameter 'c' is null"); ProcessJsonArray.numericToJava( ja, new SETTINGS_REC_BUILDER<Short, Void>( defaultValue, FLAGS & NOT_ALLOWED_RET_NULL_MASKS, (optionalUserParser == null) ? null : optionalUserParser::applyAsShort, BASIC_TYPES.PRIMITIVE_SHORT() ) .threeArgConsumer(c::accept) );
-
byteArr2
public static void byteArr2 (JsonArray ja, byte defaultValue, int FLAGS, ToByteFunction<java.lang.String> optionalUserParser, IntIntByteCons c)
Java-Consumer which accepts Primitive-Bytes & Array-IndicesInvokes: Method ProcessJsonArray.numericToJava(JsonArray, SettingsRec)Passes: Java ByteSettings-Record, w/ an "Array-Indices & Count Consumer"Removes: Any JFlagmasks which might insert null-entries in the return-streamSee: Class JFlagfor information about parameter'FLAGS'See: Flag JFlag.NOT_ALLOWED_RET_NULL_MASKSfor a list of all disallowed & filtered flags.Input-Consumer: Interface IntIntByteConsLambda-Signature: (Functional Interface) void accept (int jsonArrIndex, int acceptCount, byte value)
Example:
IntIntByteCons myConsumer = (int i1, int i2, byte primVal) -> System.out.println("jsonArr[" + i1 + "], acceptCount[" + i2 + "]: " + primVal); RJArrIntoBoxedConsumer.byteArr2(ja, -1, 0, null, myConsumer);
- Code:
- Exact Method Body:
Objects.requireNonNull(c, "IntIntByteCons parameter 'c' is null"); ProcessJsonArray.numericToJava( ja, new SETTINGS_REC_BUILDER<Byte, Void>( defaultValue, FLAGS & NOT_ALLOWED_RET_NULL_MASKS, (optionalUserParser == null) ? null : optionalUserParser::applyAsByte, BASIC_TYPES.PRIMITIVE_BYTE() ) .threeArgConsumer(c::accept) );
-
longArr2
public static void longArr2 (JsonArray ja, long defaultValue, int FLAGS, java.util.function.ToLongFunction<java.lang.String> optionalUserParser, IntIntLongCons c)
Java-Consumer which accepts Primitive Long-Integers & Array-IndicesInvokes: Method ProcessJsonArray.numericToJava(JsonArray, SettingsRec)Passes: Java LongSettings-Record, w/ an "Array-Indices & Count Consumer"Removes: Any JFlagmasks which might insert null-entries in the return-streamSee: Class JFlagfor information about parameter'FLAGS'See: Flag JFlag.NOT_ALLOWED_RET_NULL_MASKSfor a list of all disallowed & filtered flags.Input-Consumer: Interface IntIntLongConsLambda-Signature: (Functional Interface) void accept (int jsonArrIndex, int acceptCount, long value)
Example:
IntIntLongCons myConsumer = (int i1, int i2, long primVal) -> System.out.println("jsonArr[" + i1 + "], acceptCount[" + i2 + "]: " + primVal); RJArrIntoBoxedConsumer.longArr2(ja, -1, 0, null, myConsumer);
- Code:
- Exact Method Body:
Objects.requireNonNull(c, "IntIntLongCons parameter 'c' is null"); ProcessJsonArray.numericToJava( ja, new SETTINGS_REC_BUILDER<Long, Void>( defaultValue, FLAGS & NOT_ALLOWED_RET_NULL_MASKS, (optionalUserParser == null) ? null : optionalUserParser::applyAsLong, BASIC_TYPES.PRIMITIVE_LONG() ) .threeArgConsumer(c::accept) );
-
doubleArr2
public static void doubleArr2 (JsonArray ja, double defaultValue, int FLAGS, java.util.function.ToDoubleFunction<java.lang.String> optionalUserParser, IntIntDoubleCons c)
Java-Consumer which accepts Primitive-Doubles & Array-IndicesInvokes: Method ProcessJsonArray.numericToJava(JsonArray, SettingsRec)Passes: Java DoubleSettings-Record, w/ an "Array-Indices & Count Consumer"Removes: Any JFlagmasks which might insert null-entries in the return-streamSee: Class JFlagfor information about parameter'FLAGS'See: Flag JFlag.NOT_ALLOWED_RET_NULL_MASKSfor a list of all disallowed & filtered flags.Input-Consumer: Interface IntIntDoubleConsLambda-Signature: (Functional Interface) void accept (int jsonArrIndex, int acceptCount, double value)
Example:
IntIntDoubleCons myConsumer = (int i1, int i2, double primVal) -> System.out.println("jsonArr[" + i1 + "], acceptCount[" + i2 + "]: " + primVal); RJArrIntoBoxedConsumer.doubleArr2(ja, -1, 0, null, myConsumer);
- Code:
- Exact Method Body:
Objects.requireNonNull(c, "IntIntDoubleCons parameter 'c' is null"); ProcessJsonArray.numericToJava( ja, new SETTINGS_REC_BUILDER<Double, Void>( defaultValue, FLAGS & NOT_ALLOWED_RET_NULL_MASKS, (optionalUserParser == null) ? null : optionalUserParser::applyAsDouble, BASIC_TYPES.PRIMITIVE_DOUBLE() ) .threeArgConsumer(c::accept) );
-
floatArr2
public static void floatArr2 (JsonArray ja, float defaultValue, int FLAGS, ToFloatFunction<java.lang.String> optionalUserParser, IntIntFloatCons c)
Java-Consumer which accepts Primitive-Floats & Array-IndicesInvokes: Method ProcessJsonArray.numericToJava(JsonArray, SettingsRec)Passes: Java FloatSettings-Record, w/ an "Array-Indices & Count Consumer"Removes: Any JFlagmasks which might insert null-entries in the return-streamSee: Class JFlagfor information about parameter'FLAGS'See: Flag JFlag.NOT_ALLOWED_RET_NULL_MASKSfor a list of all disallowed & filtered flags.Input-Consumer: Interface IntIntFloatConsLambda-Signature: (Functional Interface) void accept (int jsonArrIndex, int acceptCount, float value)
Example:
IntIntFloatCons myConsumer = (int i1, int i2, float primVal) -> System.out.println("jsonArr[" + i1 + "], acceptCount[" + i2 + "]: " + primVal); RJArrIntoBoxedConsumer.floatArr2(ja, -1, 0, null, myConsumer);
- Code:
- Exact Method Body:
Objects.requireNonNull(c, "IntIntFloatCons parameter 'c' is null"); ProcessJsonArray.numericToJava( ja, new SETTINGS_REC_BUILDER<Float, Void>( defaultValue, FLAGS & NOT_ALLOWED_RET_NULL_MASKS, (optionalUserParser == null) ? null : optionalUserParser::applyAsFloat, BASIC_TYPES.PRIMITIVE_FLOAT() ) .threeArgConsumer(c::accept) );
-
booleanArr2
public static void booleanArr2 (JsonArray ja, boolean defaultValue, int FLAGS, java.util.function.Predicate<java.lang.String> optionalUserParser, IntIntBoolCons c)
Java-Consumer which accepts Primitive-Booleans & Array-IndicesInvokes: Method ProcessJsonArray.booleanToJava(JsonArray, SettingsRec)Passes: Java BooleanSettings-Record, w/ an "Array-Indices & Count Consumer"Removes: Any JFlagmasks which might insert null-entries in the return-streamSee: Class JFlagfor information about parameter'FLAGS'See: Flag JFlag.NOT_ALLOWED_RET_NULL_MASKSfor a list of all disallowed & filtered flags.Input-Consumer: Interface IntIntBoolConsLambda-Signature: (Functional Interface) void accept (int jsonArrIndex, int acceptCount, boolean value)
Example:
IntIntBoolCons myConsumer = (int i1, int i2, boolean primVal) -> System.out.println("jsonArr[" + i1 + "], acceptCount[" + i2 + "]: " + primVal); RJArrIntoBoxedConsumer.booleanArr2(ja, -1, 0, null, myConsumer);
- Code:
- Exact Method Body:
Objects.requireNonNull(c, "IntIntBoolCons parameter 'c' is null"); ProcessJsonArray.booleanToJava( ja, new SETTINGS_REC_BUILDER<Boolean, Void>( defaultValue, FLAGS & NOT_ALLOWED_RET_NULL_MASKS, (optionalUserParser == null) ? null : optionalUserParser::test, BASIC_TYPES.PRIMITIVE_BOOLEAN() ) .threeArgConsumer(c::accept) );
-
-