Class WrongModeException

  • All Implemented Interfaces:
    java.io.Serializable

    public class WrongModeException
    extends java.lang.RuntimeException
    If this SettingsRec instance was not configured to emit / output its data to a Consumer (of any variant), then this exception will throw on invocation of this method. This method is only valid in situations where this record was constructed to Process JsonArray data that is to be output to a Consumer.

    This exception will also throw if the type of Consumer which was used to generate this SettingsRec does not match the Type-Parameter of this Method-Signature.

    Supported Consumer Types for JSON Array Processing. You must invoke the method that has a Consumer-Parameter which matches the original-contents that were used to build this SettingsRec instance. View the two types of Java-Consumer's available, here, in the table below:
    CONSUMER TYPE DESCRIPTION OF PARAMETERS
    Consumer<T> The method will invoke the consumer with only the array element of type T. This is used when the output handler only needs the actual value from the JSON array, such as Integer, String, MyObject, etc.
    IntIntTConsumer<T> The method will invoke the consumer with three arguments:

    1. int jsonArrayIndex – The original index of the element within the JSON array

    2. int successCount – The number of valid elements processed so far (excluding skips)

    3. T element – The parsed JSON element

    This form is used when metadata such as the array index or processing count is needed during iteration, for logging, analysis, or structured output.
    See Also:
    Serialized Form


    • Method Summary

      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • serialVersionUID

        🡇     🗕  🗗  🗖
        public static final long serialVersionUID
        This fulfils the SerialVersion UID requirement for all classes that implement Java's interface java.io.Serializable. Using the Serializable Implementation offered by java is very easy, and can make saving program state when debugging a lot easier. It can also be used in place of more complicated systems like "hibernate" to store data as well.

        Note that Java's java.lang.Exception and java.lang.Error classes implement the Serializable interface, and a warning-free build expects this field be defined here.
        See Also:
        Constant Field Values
        Code:
        Exact Field Declaration Expression:
         public static final long serialVersionUID = 1;