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

public Class ComparingFields

extends Object
implements RecursiveComparisonIntrospectionStrategy
Class Inheritance
All Implemented Interfaces
org.assertj.core.api.recursive.comparison.RecursiveComparisonIntrospectionStrategy
Imports
java.util.HashSet, .Map, .Set, java.util.concurrent.ConcurrentHashMap, org.assertj.core.internal.Objects, org.assertj.core.util.introspection.FieldSupport

A RecursiveComparisonIntrospectionStrategy that introspects fields including inherited ones but ignores static and synthetic fields.

Field Summary

Modifier and TypeField and Description
public static final ComparingFields
private final Map<Class<?>, Set<String>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Object
getChildNodeValue(String
the child node identifier
childNodeName
,
Object
the object to read the child node from
instance
)

Implements org.assertj.core.api.recursive.comparison.RecursiveComparisonIntrospectionStrategy.getChildNodeValue.

Returns the value of the given object child node, the child node being identified by the childNodeName parameter.
public Set<String>
getChildrenNodeNamesOf(Object
the object to get the child nodes from
node
)

Implements org.assertj.core.api.recursive.comparison.RecursiveComparisonIntrospectionStrategy.getChildrenNodeNamesOf.

Returns the names of the children nodes of the given object that will be used in the recursive comparison.
public String
getDescription()

Overrides default org.assertj.core.api.recursive.comparison.RecursiveComparisonIntrospectionStrategy.getDescription.

Returns a human-readable description of the strategy to be used in error messages.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

COMPARING_FIELDSback to summary
public static final ComparingFields COMPARING_FIELDS
fieldNamesPerClassback to summary
private final Map<Class<?>, Set<String>> fieldNamesPerClass

Constructor Detail

ComparingFieldsback to summary
public ComparingFields()

Method Detail

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

Implements org.assertj.core.api.recursive.comparison.RecursiveComparisonIntrospectionStrategy.getChildNodeValue.

Doc from org.assertj.core.api.recursive.comparison.RecursiveComparisonIntrospectionStrategy.getChildNodeValue.

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

instance:Object

the object to read the child node from

Returns:Object

the object child node value

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

Implements org.assertj.core.api.recursive.comparison.RecursiveComparisonIntrospectionStrategy.getChildrenNodeNamesOf.

Doc from org.assertj.core.api.recursive.comparison.RecursiveComparisonIntrospectionStrategy.getChildrenNodeNamesOf.

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

Annotations
@Override
getDescriptionback to summary
public String getDescription()

Overrides default org.assertj.core.api.recursive.comparison.RecursiveComparisonIntrospectionStrategy.getDescription.

Doc from org.assertj.core.api.recursive.comparison.RecursiveComparisonIntrospectionStrategy.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

Annotations
@Override