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 org.springframework.data.redis.connection.SortParameters
SortParameters.Order, SortParameters.Range -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newDefaultSortParametersinstance.DefaultSortParameters(byte[] byPattern, SortParameters.Range limit, byte[][] getPattern, SortParameters.Order order, Boolean alphabetic) Constructs a newDefaultSortParametersinstance.DefaultSortParameters(SortParameters.Range limit, SortParameters.Order order, Boolean alphabetic) Constructs a newDefaultSortParametersinstance. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddGetPattern(byte[] gPattern) alpha()asc()by(byte[] pattern) desc()get(byte[] pattern) byte[]Returns the pattern (if set) for sorting by external keys (BY).byte[][]Returns the pattern (if set) for retrieving external keys (GET).getLimit()Returns the sorting limit (range or pagination).getOrder()Returns the sorting order.Indicates 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[][] 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(@Nullable byte[] byPattern, @Nullable SortParameters.Range limit, @Nullable byte[][] getPattern, @Nullable SortParameters.Order order, @Nullable Boolean alphabetic) Constructs a newDefaultSortParametersinstance.- Parameters:
byPattern-limit-getPattern-order-alphabetic-
-
-
Method Details
-
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
-
setGetPattern
-
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
-