public class FieldComparators extends Object
Examples: name.first or names.first but not names[1].first or names.[1].first
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,T> |
fieldHolder |
| Constructor and Description |
|---|
FieldComparators() |
| Modifier and Type | Method and Description |
|---|---|
Stream<Map.Entry<String,Comparator<?>>> |
comparatorByFields()
Returns a sequence of associated field-comparator pairs.
|
Stream<Map.Entry<String,T>> |
entryByField()
Returns a sequence of all field-entry pairs which the current holder supplies.
|
boolean |
equals(Object o) |
T |
get(String fieldLocation)
Retrieves a specific entity which is associated with the giving
filedLocation from the field holder, if it
presents. |
Comparator<?> |
getComparatorForField(String fieldLocation)
Retrieves a custom comparator, which is associated with the giving field location.
|
boolean |
hasComparatorForField(String fieldLocation)
Checks, whether an any comparator is associated with the giving field location.
|
boolean |
hasEntity(String fieldLocation)
Checks, whether an any entity associated with the giving field location.
|
int |
hashCode() |
boolean |
isEmpty() |
void |
put(String fieldLocation,
T entity)
Pairs the giving
entity with the fieldLocation. |
void |
registerComparator(String fieldLocation,
Comparator<?> comparator)
Puts the
comparator for the given fieldLocation. |
String |
toString() |
public void registerComparator(String fieldLocation, Comparator<?> comparator)
comparator for the given fieldLocation.fieldLocation - the FieldLocation where to apply the comparatorcomparator - the comparator itselfpublic boolean hasComparatorForField(String fieldLocation)
fieldLocation - the field location which association need to checkpublic Comparator<?> getComparatorForField(String fieldLocation)
fieldLocation - the field location that has to be associated with a comparatorpublic Stream<Map.Entry<String,Comparator<?>>> comparatorByFields()
public void put(String fieldLocation, T entity)
entity with the fieldLocation.fieldLocation - the field location where to apply the giving entityentity - the entity to pairpublic T get(String fieldLocation)
filedLocation from the field holder, if it
presents. Otherwise, this method returns null.fieldLocation - the field location which has to be associated with an entitypublic boolean hasEntity(String fieldLocation)
fieldLocation - the field location which association need to checkpublic boolean isEmpty()
true is there are registered entities, false otherwisepublic Stream<Map.Entry<String,T>> entryByField()
Copyright © 2025. All rights reserved.