Package org.springframework.batch.item.mail.builder

# Class SimpleMailMessageItemWriterBuilder

java.lang.Object
org.springframework.batch.item.mail.builder.SimpleMailMessageItemWriterBuilder

public class SimpleMailMessageItemWriterBuilder extends Object
Creates a fully qualified SimpleMailMessageItemWriter.

Since:
  4.0
Author:
  Glenn Renfro

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SimpleMailMessageItemWriterBuilder()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `SimpleMailMessageItemWriter`
  `build()`
  Returns a fully constructed `SimpleMailMessageItemWriter`.
  `SimpleMailMessageItemWriterBuilder`
  `mailErrorHandler(MailErrorHandler mailErrorHandler)`
  The handler for failed messages.
  `SimpleMailMessageItemWriterBuilder`
  `mailSender(org.springframework.mail.MailSender mailSender)`
  A `MailSender` to be used to send messages in `SimpleMailMessageItemWriter.write(List)`.

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

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

- ## Constructor Details

  - ### SimpleMailMessageItemWriterBuilder

    public SimpleMailMessageItemWriterBuilder()

- ## Method Details

  - ### mailSender

    public SimpleMailMessageItemWriterBuilder mailSender(org.springframework.mail.MailSender mailSender)
    A `MailSender` to be used to send messages in `SimpleMailMessageItemWriter.write(List)`.
    Parameters:
      `mailSender` - strategy for sending simple mails.
    Returns:
      this instance for method chaining.
    See Also:
      - `SimpleMailMessageItemWriter.setMailSender(MailSender)`

  - ### mailErrorHandler

    public SimpleMailMessageItemWriterBuilder mailErrorHandler(MailErrorHandler mailErrorHandler)
    The handler for failed messages. Defaults to a `DefaultMailErrorHandler`.
    Parameters:
      `mailErrorHandler` - the mail error handler to set.
    Returns:
      this instance for method chaining.
    See Also:
      - `SimpleMailMessageItemWriter.setMailErrorHandler(MailErrorHandler)`

  - ### build

    public SimpleMailMessageItemWriter build()
    Returns a fully constructed `SimpleMailMessageItemWriter`.
    Returns:
      a new `SimpleMailMessageItemWriter`