com.fasterxml.jackson.databind.util.ContainerBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of swagger-all Show documentation
Show all versions of swagger-all Show documentation
swagger-all is a rebundled verison of Swagger as one OSGi bundle.
package com.fasterxml.jackson.databind.util;
import java.lang.reflect.Array;
import java.util.*;
/**
* Helper class used for constructing "untyped" {@link java.util.List},
* {@link java.util.Map} and Object[]
values.
*
* @since 2.4
*/
public final class ContainerBuilder
{
private final static int MAX_BUF = 1000;
/**
* Buffer in which contents are being buffered (except for cases where
* size has grown too big to bother with separate buffer)
*/
private Object[] b;
/**
* Pointer to the next available slot in temporary buffer.
*/
private int tail;
/**
* When building potentailly multiple containers, we need to keep track of
* the starting pointer for the current container.
*/
private int start;
/**
* In cases where size of buffered contents has grown big enough that buffering
* does not make sense, an actual {@link java.util.List} will be constructed
* earlier and used instead of buffering.
*/
private List