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

package org.bson.json;

import org.bson.assertions.Assertions;

public final class StrictCharacterStreamJsonWriterSettings
{
    private final boolean indent;
    private final String newLineCharacters;
    private final String indentCharacters;
    private final int maxLength;
    
    public static Builder builder() {
        return new Builder();
    }
    
    private StrictCharacterStreamJsonWriterSettings(final Builder builder) {
        this.indent = builder.indent;
        this.newLineCharacters = ((builder.newLineCharacters != null) ? builder.newLineCharacters : System.getProperty("line.separator"));
        this.indentCharacters = builder.indentCharacters;
        this.maxLength = builder.maxLength;
    }
    
    public boolean isIndent() {
        return this.indent;
    }
    
    public String getNewLineCharacters() {
        return this.newLineCharacters;
    }
    
    public String getIndentCharacters() {
        return this.indentCharacters;
    }
    
    public int getMaxLength() {
        return this.maxLength;
    }
    
    public static final class Builder
    {
        private boolean indent;
        private String newLineCharacters;
        private String indentCharacters;
        private int maxLength;
        
        public StrictCharacterStreamJsonWriterSettings build() {
            return new StrictCharacterStreamJsonWriterSettings(this, null);
        }
        
        public Builder indent(final boolean indent) {
            this.indent = indent;
            return this;
        }
        
        public Builder newLineCharacters(final String newLineCharacters) {
            Assertions.notNull("newLineCharacters", newLineCharacters);
            this.newLineCharacters = newLineCharacters;
            return this;
        }
        
        public Builder indentCharacters(final String indentCharacters) {
            Assertions.notNull("indentCharacters", indentCharacters);
            this.indentCharacters = indentCharacters;
            return this;
        }
        
        public Builder maxLength(final int maxLength) {
            this.maxLength = maxLength;
            return this;
        }
        
        private Builder() {
            this.newLineCharacters = System.getProperty("line.separator");
            this.indentCharacters = "  ";
        }
    }
}
