Package org.springframework.batch.item.support.builder

# Class CompositeItemWriterBuilder<T>

java.lang.Object
org.springframework.batch.item.support.builder.CompositeItemWriterBuilder<T>

public class CompositeItemWriterBuilder<T> extends Object
Creates a fully qualified CompositeItemWriter.

Since:
  4.0
Author:
  Glenn Renfro, Drummond Dawson, Mahmoud Ben Hassine

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CompositeItemWriterBuilder()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `CompositeItemWriter<T>`
  `build()`
  Returns a fully constructed `CompositeItemWriter`.
  `CompositeItemWriterBuilder<T>`
  `delegates(List<ItemWriter<? super T>> delegates)`
  The list of item writers to use as delegates.
  `final CompositeItemWriterBuilder<T>`
  `delegates(ItemWriter<? super T>... delegates)`
  The item writers to use as delegates.
  `CompositeItemWriterBuilder<T>`
  `ignoreItemStream(boolean ignoreItemStream)`
  Establishes the policy whether to call the open, close, or update methods for the item writer delegates associated with the CompositeItemWriter.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### CompositeItemWriterBuilder

    public CompositeItemWriterBuilder()

- ## Method Details

  - ### ignoreItemStream

    public CompositeItemWriterBuilder<T> ignoreItemStream(boolean ignoreItemStream)
    Establishes the policy whether to call the open, close, or update methods for the item writer delegates associated with the CompositeItemWriter.
    Parameters:
      `ignoreItemStream` - if false the delegates' open, close, or update methods will be called when the corresponding methods on the CompositeItemWriter are called. If true the delegates' open, close, nor update methods will not be called (default is false).
    Returns:
      this instance for method chaining.
    See Also:
      - `CompositeItemWriter.setIgnoreItemStream(boolean)`

  - ### delegates

    public CompositeItemWriterBuilder<T> delegates(List<ItemWriter<? super T>> delegates)
    The list of item writers to use as delegates. Items are written to each of the delegates.
    Parameters:
      `delegates` - the list of delegates to use. The delegates list must not be null nor be empty.
    Returns:
      this instance for method chaining.
    See Also:
      - `CompositeItemWriter.setDelegates(List)`

  - ### delegates

    @SafeVarargs public final CompositeItemWriterBuilder<T> delegates(ItemWriter<? super T>... delegates)
    The item writers to use as delegates. Items are written to each of the delegates.
    Parameters:
      `delegates` - the delegates to use.
    Returns:
      this instance for method chaining.
    See Also:
      - `CompositeItemWriter.setDelegates(List)`

  - ### build

    public CompositeItemWriter<T> build()
    Returns a fully constructed `CompositeItemWriter`.
    Returns:
      a new `CompositeItemWriter`