Class QuerySortByField
-
- All Implemented Interfaces:
-
io.getstream.chat.android.models.querysort.QuerySorter
public final class QuerySortByField<T extends ComparableFieldProvider> extends BaseQuerySort<T>
Implementation of QuerySorter for fields that implements
ComparableFieldProvider. This QuerySorter doesn't use reflection and it's more performant thanQuerySortByReflection.
-
-
Field Summary
Fields Modifier and Type Field Description private List<SortSpecification<T>>sortSpecificationsprivate final Comparator<in T>comparator
-
Constructor Summary
Constructors Constructor Description QuerySortByField()
-
Method Summary
Modifier and Type Method Description Comparator<T>comparatorFromFieldSort(SortAttribute.FieldSortAttribute<T> firstSort, SortDirection sortDirection)Comparator from SortAttribute.FieldSortAttribute Comparator<T>comparatorFromNameAttribute(SortAttribute.FieldNameSortAttribute<T> name, SortDirection sortDirection)Comparator from SortAttribute.FieldNameSortAttribute final QuerySortByField<T>asc(String fieldName)Adds a field to QuerySortByField using the name of field in the direction ASC. final QuerySortByField<T>desc(String fieldName)Adds a field to QuerySortByField using the name of field in the direction DESC. final static <R extends ComparableFieldProvider> QuerySortByField<R>ascByName(String fieldName)Adds a field to QuerySortByField using the name of field in the direction ASC. final static <R extends ComparableFieldProvider> QuerySortByField<R>ascByName(QuerySortByField<R> $self, String fieldName)Creates a QuerySortByField using the name of field in the direction ASC. final static <R extends ComparableFieldProvider> QuerySortByField<R>descByName(String fieldName)Adds a field to QuerySortByField using the name of field in the direction DESC. final static <R extends ComparableFieldProvider> QuerySortByField<R>descByName(QuerySortByField<R> $self, String fieldName)Creates a QuerySortByField using the name of field in the direction DESC. -
Methods inherited from class io.getstream.chat.android.models.querysort.BaseQuerySort
equals, getComparator, getSortSpecifications, hashCode, setSortSpecifications, toDto, toString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
comparatorFromFieldSort
Comparator<T> comparatorFromFieldSort(SortAttribute.FieldSortAttribute<T> firstSort, SortDirection sortDirection)
Comparator from SortAttribute.FieldSortAttribute
-
comparatorFromNameAttribute
Comparator<T> comparatorFromNameAttribute(SortAttribute.FieldNameSortAttribute<T> name, SortDirection sortDirection)
Comparator from SortAttribute.FieldNameSortAttribute
-
asc
final QuerySortByField<T> asc(String fieldName)
Adds a field to QuerySortByField using the name of field in the direction ASC.
- Parameters:
fieldName- The name of the field.
-
desc
final QuerySortByField<T> desc(String fieldName)
Adds a field to QuerySortByField using the name of field in the direction DESC.
- Parameters:
fieldName- The name of the field.
-
ascByName
final static <R extends ComparableFieldProvider> QuerySortByField<R> ascByName(String fieldName)
Adds a field to QuerySortByField using the name of field in the direction ASC.
- Parameters:
fieldName- Field name.
-
ascByName
final static <R extends ComparableFieldProvider> QuerySortByField<R> ascByName(QuerySortByField<R> $self, String fieldName)
Creates a QuerySortByField using the name of field in the direction ASC.
- Parameters:
fieldName- Field name.
-
descByName
final static <R extends ComparableFieldProvider> QuerySortByField<R> descByName(String fieldName)
Adds a field to QuerySortByField using the name of field in the direction DESC.
- Parameters:
fieldName- Field name.
-
descByName
final static <R extends ComparableFieldProvider> QuerySortByField<R> descByName(QuerySortByField<R> $self, String fieldName)
Creates a QuerySortByField using the name of field in the direction DESC.
- Parameters:
fieldName- Field name.
-
-
-
-