Class FieldComparators
- java.lang.Object
-
- org.assertj.core.api.recursive.comparison.FieldComparators
-
public class FieldComparators extends Object
An internal holder of the comparators for fields described by their path without element index.Examples:
name.first
ornames.first
but notnames[1].first
ornames.[1].first
-
-
Field Summary
Fields Modifier and Type Field Description (package private) Map<String,Comparator<?>>
fieldComparators
-
Constructor Summary
Constructors Constructor Description FieldComparators()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stream<Map.Entry<String,Comparator<?>>>
comparatorByFields()
boolean
equals(Object obj)
private static String
formatRegisteredComparator(Map.Entry<String,Comparator<?>> fieldComparator)
Comparator<?>
getComparatorForField(String fieldLocation)
boolean
hasComparatorForField(String fieldLocation)
int
hashCode()
boolean
isEmpty()
void
registerComparator(String fieldLocation, Comparator<?> comparator)
Puts thecomparator
for the givenclazz
.String
toString()
-
-
-
Field Detail
-
fieldComparators
Map<String,Comparator<?>> fieldComparators
-
-
Method Detail
-
registerComparator
public void registerComparator(String fieldLocation, Comparator<?> comparator)
Puts thecomparator
for the givenclazz
.- Parameters:
fieldLocation
- the FieldLocation where to apply the comparatorcomparator
- the comparator it self
-
isEmpty
public boolean isEmpty()
- Returns:
true
is there are registered comparators,false
otherwise
-
formatRegisteredComparator
private static String formatRegisteredComparator(Map.Entry<String,Comparator<?>> fieldComparator)
-
hasComparatorForField
public boolean hasComparatorForField(String fieldLocation)
-
getComparatorForField
public Comparator<?> getComparatorForField(String fieldLocation)
-
comparatorByFields
public Stream<Map.Entry<String,Comparator<?>>> comparatorByFields()
-
-