Class DefaultSortParameters
java.lang.Object
org.springframework.data.redis.connection.DefaultSortParameters
- All Implemented Interfaces:
SortParameters
Default implementation for
SortParameters.- Author:
- Costin Leau
-
Nested Class Summary
Nested classes/interfaces inherited from interface SortParameters
SortParameters.Order, SortParameters.Range -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newDefaultSortParametersinstance.DefaultSortParameters(byte @Nullable [] byPattern, @Nullable SortParameters.Range limit, byte @Nullable [][] getPattern, @Nullable SortParameters.Order order, @Nullable Boolean alphabetic) Constructs a newDefaultSortParametersinstance.DefaultSortParameters(@Nullable SortParameters.Range limit, @Nullable SortParameters.Order order, @Nullable Boolean alphabetic) Constructs a newDefaultSortParametersinstance. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddGetPattern(byte @Nullable [] gPattern) alpha()asc()by(byte[] pattern) desc()get(byte[] pattern) byte @Nullable []Returns the pattern (if set) for sorting by external keys (BY).byte[][]Returns the pattern (if set) for retrieving external keys (GET).@Nullable SortParameters.RangegetLimit()Returns the sorting limit (range or pagination).@Nullable SortParameters.OrdergetOrder()Returns the sorting order.@Nullable BooleanIndicates if the sorting is numeric (default) or alphabetical (lexicographical).limit(long start, long count) numeric()order(SortParameters.Order order) voidsetAlphabetic(Boolean alphabetic) voidsetByPattern(byte[] byPattern) voidsetGetPattern(byte @Nullable [][] gPattern) voidsetLimit(SortParameters.Range limit) voidsetOrder(SortParameters.Order order)
-
Constructor Details
-
DefaultSortParameters
public DefaultSortParameters()Constructs a newDefaultSortParametersinstance. -
DefaultSortParameters
public DefaultSortParameters(@Nullable SortParameters.Range limit, @Nullable SortParameters.Order order, @Nullable Boolean alphabetic) Constructs a newDefaultSortParametersinstance.- Parameters:
limit-order-alphabetic-
-
DefaultSortParameters
public DefaultSortParameters(byte @Nullable [] byPattern, @Nullable SortParameters.Range limit, byte @Nullable [][] getPattern, @Nullable SortParameters.Order order, @Nullable Boolean alphabetic) Constructs a newDefaultSortParametersinstance.- Parameters:
byPattern-limit-getPattern-order-alphabetic-
-
-
Method Details
-
getByPattern
public byte @Nullable [] getByPattern()Description copied from interface:SortParametersReturns the pattern (if set) for sorting by external keys (BY). Can be null if nothing is specified.- Specified by:
getByPatternin interfaceSortParameters- Returns:
BYpattern. null if not set.
-
setByPattern
public void setByPattern(byte[] byPattern) -
getLimit
Description copied from interface:SortParametersReturns the sorting limit (range or pagination). Can be null if nothing is specified.- Specified by:
getLimitin interfaceSortParameters- Returns:
- sorting limit/range. null if not set.
-
setLimit
-
getGetPattern
public byte[][] getGetPattern()Description copied from interface:SortParametersReturns the pattern (if set) for retrieving external keys (GET). Can be null if nothing is specified.- Specified by:
getGetPatternin interfaceSortParameters- Returns:
GETpattern. null if not set.
-
addGetPattern
public void addGetPattern(byte @Nullable [] gPattern) -
setGetPattern
public void setGetPattern(byte @Nullable [][] gPattern) -
getOrder
Description copied from interface:SortParametersReturns the sorting order. Can be null if nothing is specified.- Specified by:
getOrderin interfaceSortParameters- Returns:
- sorting order. null if not set.
-
setOrder
-
isAlphabetic
Description copied from interface:SortParametersIndicates if the sorting is numeric (default) or alphabetical (lexicographical). Can be null if nothing is specified.- Specified by:
isAlphabeticin interfaceSortParameters- Returns:
- the type of sorting. null if not set.
-
setAlphabetic
-
order
-
alpha
-
asc
-
desc
-
numeric
-
get
-
by
-
limit
-