Class Sort
- java.lang.Object
-
- com.rbmhtechnology.vind.api.query.sort.Sort
-
- Direct Known Subclasses:
Sort.DescriptorSort
,Sort.SimpleSort
,Sort.SpecialSort
,SortMixIn
public abstract class Sort extends Object
Sorting Abstract Class with static friendly user methods to create sorting query objects and to be implemented by basic sort objects.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Sort.DescriptorSort
Sorting class which sorts results based on a field.static class
Sort.Direction
static class
Sort.Score
Sorting class which enables sorting result by score.static class
Sort.SimpleSort
Sorting class which sorts results based on a field.static class
Sort.SpecialSort
Abstract class to be implemented by complex sorting objects.
-
Field Summary
Fields Modifier and Type Field Description protected Sort.Direction
direction
-
Constructor Summary
Constructors Constructor Description Sort()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static Sort
asc(Sort.SpecialSort sort)
Sets aSort.SpecialSort
object direction to ascending.static Sort
asc(FieldDescriptor descriptor)
Instantiates a newSort.DescriptorSort
object with direction set to ascending.static Sort
asc(String field)
Instantiates a newSort.SimpleSort
object with direction set to ascending.abstract Sort
clone()
static Sort
desc(Sort.SpecialSort sort)
Sets aSort.SpecialSort
object direction to descending.static Sort
desc(FieldDescriptor descriptor)
Instantiates a newSort.DescriptorSort
object with direction set to descending.static Sort
desc(String field)
Instantiates a newSort.SimpleSort
object with direction set to descending.static Sort
field(FieldDescriptor descriptor, Sort.Direction direction)
Instantiates a newSort.DescriptorSort
object with direction set to ascending.static Sort
field(SingleValuedComplexField descriptor, Sort.Direction direction)
Instantiates a newSort.DescriptorSort
object with direction set to ascending.static Sort
field(String field, Sort.Direction direction)
Instantiates a newSort.SimpleSort
object with direction set to ascending.Sort.Direction
getDirection()
Gets the sorting directionString
getType()
Gets the type of the sorting configuration
-
-
-
Field Detail
-
direction
protected Sort.Direction direction
-
-
Method Detail
-
asc
public static Sort asc(Sort.SpecialSort sort)
Sets aSort.SpecialSort
object direction to ascending.- Parameters:
sort
- specificSort.SpecialSort
object.- Returns:
Sort
object with an ascending direction.
-
desc
public static Sort desc(Sort.SpecialSort sort)
Sets aSort.SpecialSort
object direction to descending.- Parameters:
sort
- specificSort.SpecialSort
object.- Returns:
Sort
object with an descending direction.
-
asc
public static Sort asc(String field)
Instantiates a newSort.SimpleSort
object with direction set to ascending.- Parameters:
field
- String name of the field to sort on.- Returns:
Sort
object with an ascending direction.
-
asc
public static Sort asc(FieldDescriptor descriptor)
Instantiates a newSort.DescriptorSort
object with direction set to ascending.- Parameters:
descriptor
-SingleValueFieldDescriptor
specifying the field to sort on.- Returns:
Sort
object with an ascending direction.
-
field
public static Sort field(String field, Sort.Direction direction)
Instantiates a newSort.SimpleSort
object with direction set to ascending.- Parameters:
field
- String name of the field to sort on.direction
-Sort.Direction
to set the sorting direction (asc, desc).- Returns:
Sort
object with the given direction.
-
field
public static Sort field(SingleValuedComplexField descriptor, Sort.Direction direction)
Instantiates a newSort.DescriptorSort
object with direction set to ascending.- Parameters:
descriptor
-SingleValuedComplexField
specifying the field to sort on.direction
-Sort.Direction
to set the sorting direction (asc, desc).- Returns:
Sort
object with the given direction.
-
field
public static Sort field(FieldDescriptor descriptor, Sort.Direction direction)
Instantiates a newSort.DescriptorSort
object with direction set to ascending.- Parameters:
descriptor
-SingleValueFieldDescriptor
specifying the field to sort on.direction
-Sort.Direction
to set the sorting direction (asc, desc).- Returns:
Sort
object with the given direction.
-
desc
public static Sort desc(String field)
Instantiates a newSort.SimpleSort
object with direction set to descending.- Parameters:
field
- String name of the field to sort on.- Returns:
Sort
object with an descending direction.
-
desc
public static Sort desc(FieldDescriptor descriptor)
Instantiates a newSort.DescriptorSort
object with direction set to descending.- Parameters:
descriptor
-SingleValueFieldDescriptor
specifying the field to sort on.- Returns:
Sort
object with an descending direction.
-
getDirection
public Sort.Direction getDirection()
Gets the sorting direction- Returns:
Sort.Direction
-
-