class ObjectWriterImplDoubleValueArray
        extends ObjectWriterPrimitiveImpl {
    static final ObjectWriterImplDoubleValueArray INSTANCE = new ObjectWriterImplDoubleValueArray(null);
    static final byte[] JSONB_TYPE_NAME_BYTES = JSONB.toBytes("[D");
    static final long JSONB_TYPE_HASH = Fnv.hashCode64("[D");

    final DecimalFormat format;

    private final Function<Object, double[]> function;

    public ObjectWriterImplDoubleValueArray(DecimalFormat format) {
        this.format = format;
        this.function = null;
    }

    public ObjectWriterImplDoubleValueArray(Function<Object, double[]> function, DecimalFormat format) {
        this.function = function;
        this.format = format;
    }

    @Override
    public void writeJSONB(JSONWriter jsonWriter, Object object, Object fieldName, Type fieldType, long features) {
        if (jsonWriter.isWriteTypeInfo(object, fieldType)) {
            jsonWriter.writeTypeName(JSONB_TYPE_NAME_BYTES, JSONB_TYPE_HASH);
        }

        double[] array;
        if (function != null && object != null) {
            array = function.apply(object);
        } else {
            array = (double[]) object;
        }
        jsonWriter.writeDouble(array);
    }

    @Override
    public void write(JSONWriter jsonWriter, Object object, Object fieldName, Type fieldType, long features) {<FILL_FUNCTION_BODY>}
}

        double[] array;
        if (function != null && object != null) {
            array = function.apply(object);
        } else {
            array = (double[]) object;
        }

        if (format == null) {
            jsonWriter.writeDouble(array);
        } else {
            jsonWriter.writeDouble(array, format);
        }
    
<methods>public non-sealed void <init>() ,public Function#RAW getFunction() ,public void writeArrayMapping(com.alibaba.fastjson2.JSONWriter, java.lang.Object, java.lang.Object, java.lang.reflect.Type, long) ,public void writeArrayMappingJSONB(com.alibaba.fastjson2.JSONWriter, java.lang.Object, java.lang.Object, java.lang.reflect.Type, long) <variables>