// 
// Decompiled by Procyon v0.6.0
// 

package io.sentry;

import org.jetbrains.annotations.Nullable;
import java.io.IOException;
import java.io.Writer;
import org.jetbrains.annotations.NotNull;
import io.sentry.vendor.gson.stream.JsonWriter;

public final class JsonObjectWriter implements ObjectWriter
{
    @NotNull
    private final JsonWriter jsonWriter;
    @NotNull
    private final JsonObjectSerializer jsonObjectSerializer;
    
    public JsonObjectWriter(@NotNull final Writer out, final int maxDepth) {
        this.jsonWriter = new JsonWriter(out);
        this.jsonObjectSerializer = new JsonObjectSerializer(maxDepth);
    }
    
    @Override
    public JsonObjectWriter beginArray() throws IOException {
        this.jsonWriter.beginArray();
        return this;
    }
    
    @Override
    public JsonObjectWriter endArray() throws IOException {
        this.jsonWriter.endArray();
        return this;
    }
    
    @Override
    public JsonObjectWriter beginObject() throws IOException {
        this.jsonWriter.beginObject();
        return this;
    }
    
    @Override
    public JsonObjectWriter endObject() throws IOException {
        this.jsonWriter.endObject();
        return this;
    }
    
    @Override
    public JsonObjectWriter name(@NotNull final String name) throws IOException {
        this.jsonWriter.name(name);
        return this;
    }
    
    @Override
    public JsonObjectWriter value(@Nullable final String value) throws IOException {
        this.jsonWriter.value(value);
        return this;
    }
    
    @Override
    public ObjectWriter jsonValue(@Nullable final String value) throws IOException {
        this.jsonWriter.jsonValue(value);
        return this;
    }
    
    @Override
    public JsonObjectWriter nullValue() throws IOException {
        this.jsonWriter.nullValue();
        return this;
    }
    
    @Override
    public JsonObjectWriter value(final boolean value) throws IOException {
        this.jsonWriter.value(value);
        return this;
    }
    
    @Override
    public JsonObjectWriter value(@Nullable final Boolean value) throws IOException {
        this.jsonWriter.value(value);
        return this;
    }
    
    @Override
    public JsonObjectWriter value(final double value) throws IOException {
        this.jsonWriter.value(value);
        return this;
    }
    
    @Override
    public JsonObjectWriter value(final long value) throws IOException {
        this.jsonWriter.value(value);
        return this;
    }
    
    @Override
    public JsonObjectWriter value(@Nullable final Number value) throws IOException {
        this.jsonWriter.value(value);
        return this;
    }
    
    @Override
    public JsonObjectWriter value(@NotNull final ILogger logger, @Nullable final Object object) throws IOException {
        this.jsonObjectSerializer.serialize(this, logger, object);
        return this;
    }
    
    @Override
    public void setLenient(final boolean lenient) {
        this.jsonWriter.setLenient(lenient);
    }
    
    @Override
    public void setIndent(@Nullable final String indent) {
        this.jsonWriter.setIndent(indent);
    }
    
    @Nullable
    @Override
    public String getIndent() {
        return this.jsonWriter.getIndent();
    }
}
