Package net.jazdw.rql.util
Interface PropertyAccessor<T,R>
public interface PropertyAccessor<T,R>
-
Method Summary
Modifier and TypeMethodDescriptiondefault Comparator<Object> getComparator(String property) Get a comparator for the given property namegetProperty(T item, String property) Get the value of an item's property/fielddefault Comparator<T> getSortComparator(String property) Get a comparator that can be used to sort a list of items by a certain property
-
Method Details
-
getProperty
Get the value of an item's property/field- Parameters:
item- any objectproperty- name of the property/field, could be a JSON pointer for example. May be null to represent the object itself.- Returns:
- value of the property/field
-
getComparator
Get a comparator for the given property name- Parameters:
property- name of the property/field, could be a JSON pointer for example May be null to represent the object itself.- Returns:
- comparator for property
-
getSortComparator
Get a comparator that can be used to sort a list of items by a certain property- Parameters:
property- name of the property/field, could be a JSON pointer for example May be null to represent the object itself.- Returns:
- comparator for sorting
-