// Path: a-foundation/src/main/java/com/ajjpj/afoundation/function/AStatement1.java
// public interface AStatement1<P, E extends Throwable> extends Serializable {
//     void apply(P param) throws E;
// }


import com.ajjpj.afoundation.function.AStatement1;
import java.io.*;
import java.nio.charset.Charset;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Locale;
    public void writeStringArray (Iterable<String> values) throws IOException {
        startArray ();
        for (String el: values) writeStringLiteral (el);
        endArray ();
    }

    public void writeStringField (String key, String value) throws IOException {
        writeKey (key);
        writeStringLiteral (value);
    }
    public void writeBooleanField (String key, Boolean value) throws IOException {
        writeKey (key);
        if (value == null) writeNullLiteral ();
        else writeBooleanLiteral (value);
    }
    public void writeIntField (String key, Integer value) throws IOException {
        writeKey (key);
        if (value == null) writeNullLiteral ();
        else writeIntLiteral (value);
    }
    public void writeLongField (String key, Long value) throws IOException {
        writeKey (key);
        if (value == null) writeNullLiteral ();
        else writeLongLiteral (value);
    }

    /**
     * This is a convenience method for building simple JSON strings. It passes an AJsonSerHelper to a callback and
     *  builds a string based on what the callback does with it.
     */
// Path: a-foundation/src/main/java/com/ajjpj/afoundation/function/AStatement1.java
// public interface AStatement1<P, E extends Throwable> extends Serializable {
//     void apply(P param) throws E;
// }


// Path: a-foundation/src/main/java/com/ajjpj/afoundation/io/AJsonSerHelper.java
import com.ajjpj.afoundation.function.AStatement1;
import java.io.*;
import java.nio.charset.Charset;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Locale;

    public void writeStringArray (Iterable<String> values) throws IOException {
        startArray ();
        for (String el: values) writeStringLiteral (el);
        endArray ();
    }

    public void writeStringField (String key, String value) throws IOException {
        writeKey (key);
        writeStringLiteral (value);
    }
    public void writeBooleanField (String key, Boolean value) throws IOException {
        writeKey (key);
        if (value == null) writeNullLiteral ();
        else writeBooleanLiteral (value);
    }
    public void writeIntField (String key, Integer value) throws IOException {
        writeKey (key);
        if (value == null) writeNullLiteral ();
        else writeIntLiteral (value);
    }
    public void writeLongField (String key, Long value) throws IOException {
        writeKey (key);
        if (value == null) writeNullLiteral ();
        else writeLongLiteral (value);
    }

    /**
     * This is a convenience method for building simple JSON strings. It passes an AJsonSerHelper to a callback and
     *  builds a string based on what the callback does with it.
     */
    public static <E extends Throwable> String buildString (AStatement1<AJsonSerHelper, E> code) throws E {