Class JsonArrayIterator.Builder<T>

    • Method Detail

      • valueCreator

        public JsonArrayIterator.Builder<T> valueCreator​(@Nullable BiFunction<com.fasterxml.jackson.core.JsonParser,​com.fasterxml.jackson.core.TreeNode,​T> valueCreator)
        Parameters:
        valueCreator - A function which converts a json TreeNode to the desired objects in the iterator.
        Returns:
        this.
      • valueClass

        public JsonArrayIterator.Builder<T> valueClass​(@Nullable Class<T> valueClass)
        Parameters:
        valueClass - If valueCreator is not given, simply the class of the desired object can be given Json unmarshalling with the given objectMapper will happen.
        Returns:
        this.
      • callback

        public JsonArrayIterator.Builder<T> callback​(@Nullable Runnable callback)
        Parameters:
        callback - If the iterator is ready, closed or error this callback will be called.
        Returns:
        this.
      • sizeField

        public JsonArrayIterator.Builder<T> sizeField​(@Nullable String sizeField)
        Parameters:
        sizeField - The size of the iterator, i.e. the size of the array represented in the json stream
        Returns:
        this.
      • totalSizeField

        public JsonArrayIterator.Builder<T> totalSizeField​(@Nullable String totalSizeField)
        Parameters:
        totalSizeField - Sometimes the array is part of something bigger, e.g. a page in a search result. The size of the 'complete' result can be in the beginning of the json in this field.
        Returns:
        this.
      • objectMapper

        public JsonArrayIterator.Builder<T> objectMapper​(@Nullable com.fasterxml.jackson.databind.ObjectMapper objectMapper)
        Parameters:
        objectMapper - Default the objectMapper Jackson2Mapper.getLenientInstance() will be used (in conjuction with valueClass, but you may specify another one
        Returns:
        this.
      • logger

        public JsonArrayIterator.Builder<T> logger​(@Nullable org.slf4j.Logger logger)
        Parameters:
        logger - Default this is logging to nl.vpro.jackson2.JsonArrayIterator, but you may override that.
        Returns:
        this.