Top Description Methods
org.assertj.core.api.recursive.comparison

public Interface RecursiveComparisonIntrospectionStrategy

Known Direct Implementers
org.assertj.core.api.recursive.comparison.ComparingFields, org.assertj.core.api.recursive.comparison.ComparingNormalizedFields, org.assertj.core.api.recursive.comparison.ComparingProperties, org.assertj.core.api.recursive.comparison.DefaultRecursiveComparisonIntrospectionStrategy
Annotations
@Beta
Imports
java.util.Set, org.assertj.core.annotations.Beta

Defines how objects are introspected in the recursive comparison, the main operations it specifies are:

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

the object child node value
getChildNodeValue
(String
the child node identifier
childNodeName
,
Object
the object to read the child node from
object
)

Returns the value of the given object child node, the child node being identified by the childNodeName parameter.

public Set<String>

Returns:

the names of the children nodes of the given object
getChildrenNodeNamesOf
(Object
the object to get the child nodes from
node
)

Returns the names of the children nodes of the given object that will be used in the recursive comparison.

public default String

Returns:

a description of the strategy
getDescription
()

Returns a human-readable description of the strategy to be used in error messages.

Method Detail

getChildNodeValueback to summary
public Object getChildNodeValue(String childNodeName, Object object)

Returns the value of the given object child node, the child node being identified by the childNodeName parameter.

It's the implementor choice how to resolve the child node value, a typical implementation consists of considering childNodeName to be a field name and then use introspection to read the field value, but if the object is a Map the implementation could consider the child node name to be a key of the map.

Parameters
childNodeName:String

the child node identifier

object:Object

the object to read the child node from

Returns:Object

the object child node value

getChildrenNodeNamesOfback to summary
public Set<String> getChildrenNodeNamesOf(Object node)

Returns the names of the children nodes of the given object that will be used in the recursive comparison.

A typical implementation could look at the object fields or properties.

Parameters
node:Object

the object to get the child nodes from

Returns:Set<String>

the names of the children nodes of the given object

getDescriptionback to summary
public default String getDescription()

Returns a human-readable description of the strategy to be used in error messages.

The default implementation returns this.getClass().getSimpleName().

Returns:String

a description of the strategy