DiffBuilder.Builder (Apache Commons Lang 3.17.0 API)
Description: declaration: package: org.apache.commons.lang3.builder, class: DiffBuilder, class: Builder

Package org.apache.commons.lang3.builder

# Class DiffBuilder.Builder<T>

java.lang.Object
org.apache.commons.lang3.builder.DiffBuilder.Builder<T>

Type Parameters:
  `T` - type of the left and right object.

Enclosing class:
  DiffBuilder<T>

public static final class DiffBuilder.Builder<T> extends Object
Constructs a new instance.

Since:
  3.15.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Builder()`
  Constructs a new instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `DiffBuilder<T>`
  `build()`
  Builds a new configured `DiffBuilder`.
  `DiffBuilder.Builder<T>`
  `setLeft(T left)`
  Sets the left object.
  `DiffBuilder.Builder<T>`
  `setRight(T right)`
  Sets the right object.
  `DiffBuilder.Builder<T>`
  `setStyle(ToStringStyle style)`
  Sets the style will to use when outputting the objects, `null` uses the default.
  `DiffBuilder.Builder<T>`
  `setTestObjectsEquals(boolean testObjectsEquals)`
  Sets whether to test if left and right are the same or equal.
  `DiffBuilder.Builder<T>`
  `setToStringFormat(String toStringFormat)`
  Sets the two-argument format string for `String.format(String, Object...)`, for example `"%s differs from %s"`.

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

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

- ## Constructor Details

  - ### Builder

    public Builder()
    Constructs a new instance.

- ## Method Details

  - ### build

    public DiffBuilder<T> build()
    Builds a new configured `DiffBuilder`.
    Returns:
      a new configured `DiffBuilder`.

  - ### setLeft

    public DiffBuilder.Builder<T> setLeft(T left)
    Sets the left object.
    Parameters:
      `left` - the left object.
    Returns:
      `this` instance.

  - ### setRight

    public DiffBuilder.Builder<T> setRight(T right)
    Sets the right object.
    Parameters:
      `right` - the left object.
    Returns:
      `this` instance.

  - ### setStyle

    public DiffBuilder.Builder<T> setStyle(ToStringStyle style)
    Sets the style will to use when outputting the objects, `null` uses the default.
    Parameters:
      `style` - the style to use when outputting the objects, `null` uses the default.
    Returns:
      `this` instance.

  - ### setTestObjectsEquals

    public DiffBuilder.Builder<T> setTestObjectsEquals(boolean testObjectsEquals)
    Sets whether to test if left and right are the same or equal. All of the append(fieldName, left, right) methods will abort without creating a field `Diff` if the trivially equal test is enabled and returns true. The result of this test is never changed throughout the life of this `DiffBuilder`.
    Parameters:
      `testObjectsEquals` - If true, this will test if lhs and rhs are the same or equal. All of the append(fieldName, left, right) methods will abort without creating a field `Diff` if the trivially equal test is enabled and returns true. The result of this test is never changed throughout the life of this `DiffBuilder`.
    Returns:
      `this` instance.

  - ### setToStringFormat

    public DiffBuilder.Builder<T> setToStringFormat(String toStringFormat)
    Sets the two-argument format string for `String.format(String, Object...)`, for example `"%s differs from %s"`.
    Parameters:
      `toStringFormat` - `null` uses the default.
    Returns:
      `this` instance.