Package org.springframework.batch.item.avro.builder

# Class AvroItemWriterBuilder<T>

java.lang.Object
org.springframework.batch.item.avro.builder.AvroItemWriterBuilder<T>

public class AvroItemWriterBuilder<T> extends Object
A builder implementation for the `AvroItemWriter`.

Since:
  4.2
Author:
  David Turanski, Mahmoud Ben Hassine

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AvroItemWriterBuilder()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `AvroItemWriter<T>`
  `build()`
  Build an instance of `AvroItemWriter`.
  `AvroItemWriterBuilder<T>`
  `name(String name)`
  The name used to calculate the key within the `ExecutionContext`.
  `AvroItemWriterBuilder<T>`
  `resource(org.springframework.core.io.WritableResource resource)`
  `AvroItemWriterBuilder<T>`
  `schema(String schemaString)`
  `AvroItemWriterBuilder<T>`
  `schema(org.springframework.core.io.Resource schema)`
  `AvroItemWriterBuilder<T>`
  `type(Class<T> type)`

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

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

- ## Constructor Details

  - ### AvroItemWriterBuilder

    public AvroItemWriterBuilder()

- ## Method Details

  - ### resource

    public AvroItemWriterBuilder<T> resource(org.springframework.core.io.WritableResource resource)
    Parameters:
      `resource` - the `WritableResource` used to write the serialized data.
    Returns:
      The current instance of the builder.

  - ### schema

    public AvroItemWriterBuilder<T> schema(org.springframework.core.io.Resource schema)
    Parameters:
      `schema` - the Resource containing the schema JSON used to serialize the output.
    Returns:
      The current instance of the builder.

  - ### schema

    public AvroItemWriterBuilder<T> schema(String schemaString)
    Parameters:
      `schemaString` - the String containing the schema JSON used to serialize the output.
    Returns:
      The current instance of the builder.

  - ### type

    public AvroItemWriterBuilder<T> type(Class<T> type)
    Parameters:
      `type` - the Class of objects to be serialized.
    Returns:
      The current instance of the builder.

  - ### name

    public AvroItemWriterBuilder<T> name(String name)
    The name used to calculate the key within the `ExecutionContext`.
    Parameters:
      `name` - name of the reader instance
    Returns:
      The current instance of the builder.
    See Also:
      - `ItemStreamSupport.setName(String)`

  - ### build

    public AvroItemWriter<T> build()
    Build an instance of `AvroItemWriter`.
    Returns:
      the instance;