(@Nullable Object input, int maxDepth, int depthRemaining)
| 413 | } |
| 414 | |
| 415 | private JsonOutput write0(@Nullable Object input, int maxDepth, int depthRemaining) { |
| 416 | if (input == null) { |
| 417 | append("null"); |
| 418 | return this; |
| 419 | } |
| 420 | |
| 421 | // Fast paths for the classes that dominate real payloads, mirroring the corresponding |
| 422 | // converters and skipping the per-class strategy lookup. |
| 423 | Class<?> cls = input.getClass(); |
| 424 | if (cls == String.class) { |
| 425 | writeString(input); |
| 426 | } else if (cls == Long.class || cls == Integer.class || cls == Double.class) { |
| 427 | append(input.toString()); |
| 428 | } else if (cls == Boolean.class) { |
| 429 | append((Boolean) input ? "true" : "false"); |
| 430 | } else { |
| 431 | CONVERTERS.get(cls).consume(this, input, maxDepth, depthRemaining); |
| 432 | } |
| 433 | |
| 434 | return this; |
| 435 | } |
| 436 | |
| 437 | /** |
| 438 | * {@inheritDoc} |
no test coverage detected