DiffBuilder.Builder

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

Constructs a new instance.

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

build()

Builds a new configured DiffBuilder.

setLeft(Object)

Sets the left object.

setRight(Object)

Sets the right object.

setStyle(ToStringStyle)

Sets the style will to use when outputting the objects, null uses the default.

setTestObjectsEquals(boolean)

Sets whether to test if left and right are the same or equal.

setToStringFormat(String)

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.