MCPcopy
hub / github.com/google/gson / setIndent

Method setIndent

src/main/java/com/google/gson/stream/JsonWriter.java:168–176  ·  view source on GitHub ↗

Sets the indentation string to be repeated for each level of indentation in the encoded document. If indent.isEmpty() the encoded document will be compact. Otherwise the encoded document will be more human-readable. @param indent a string containing only whitespace.

(String indent)

Source from the content-addressed store, hash-verified

166 * @param indent a string containing only whitespace.
167 */
168 public void setIndent(String indent) {
169 if (indent.length() == 0) {
170 this.indent = null;
171 this.separator = ":";
172 } else {
173 this.indent = indent;
174 this.separator = ": ";
175 }
176 }
177
178 /**
179 * Configure this writer to relax its syntax rules. By default, this writer

Callers 4

testPrettyPrintObjectMethod · 0.95
testPrettyPrintArrayMethod · 0.95
toJsonMethod · 0.95

Calls 1

lengthMethod · 0.80

Tested by 3

testPrettyPrintObjectMethod · 0.76
testPrettyPrintArrayMethod · 0.76