On this page

DiffBuilder.Builder

public static final class org.apache.commons.lang3.builder.DiffBuilder.Builder<T>[source]

Constructs a new instance.

Type parameters:

<T> – type of the left and right object.

Since:

3.15.0

Constructors

Builder()

Constructs a new instance.

public Builder()[source]

Constructs a new instance.

Methods

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".

public DiffBuilder<T> build()[source]

Builds a new configured DiffBuilder.

Returns:

A new configured DiffBuilder.

public DiffBuilder.Builder<T> setLeft(T left)[source]

Sets the left object.

Parameters:

left – The left object.

Returns:

this instance.

public DiffBuilder.Builder<T> setRight(T right)[source]

Sets the right object.

Parameters:

right – The left object.

Returns:

this instance.

public DiffBuilder.Builder<T> setStyle(ToStringStyle style)[source]

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.

public DiffBuilder.Builder<T> setTestObjectsEquals(boolean testObjectsEquals)[source]

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.

public DiffBuilder.Builder<T> setToStringFormat(String toStringFormat)[source]

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.