Spring Data Key-Value

org.springframework.data.keyvalue.redis.connection
Class DefaultSortParameters

java.lang.Object
  extended by org.springframework.data.keyvalue.redis.connection.DefaultSortParameters
All Implemented Interfaces:
SortParameters

public class DefaultSortParameters
extends Object
implements SortParameters

Default implementation for SortParameters.

Author:
Costin Leau

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.springframework.data.keyvalue.redis.connection.SortParameters
SortParameters.Order, SortParameters.Range
 
Constructor Summary
DefaultSortParameters()
          Constructs a new DefaultSortParameters instance.
DefaultSortParameters(byte[] byPattern, SortParameters.Range limit, byte[][] getPattern, SortParameters.Order order, Boolean alphabetic)
          Constructs a new DefaultSortParameters instance.
DefaultSortParameters(SortParameters.Range limit, SortParameters.Order order, Boolean alphabetic)
          Constructs a new DefaultSortParameters instance.
 
Method Summary
 void addGetPattern(byte[] gPattern)
           
 DefaultSortParameters alpha()
           
 DefaultSortParameters asc()
           
 DefaultSortParameters by(byte[] pattern)
           
 DefaultSortParameters desc()
           
 DefaultSortParameters get(byte[] pattern)
           
 byte[] getByPattern()
          Returns the pattern (if set) for sorting by external keys (BY).
 byte[][] getGetPattern()
          Returns the pattern (if set) for retrieving external keys (GET).
 SortParameters.Range getLimit()
          Returns the sorting limit (range or pagination).
 SortParameters.Order getOrder()
          Returns the sorting order.
 Boolean isAlphabetic()
          Indicates if the sorting is numeric (default) or alphabetical (lexicographical).
 DefaultSortParameters limit(long start, long count)
           
 DefaultSortParameters numeric()
           
 DefaultSortParameters order(SortParameters.Order order)
           
 void setAlphabetic(Boolean alphabetic)
           
 void setByPattern(byte[] byPattern)
           
 void setGetPattern(byte[][] gPattern)
           
 void setLimit(SortParameters.Range limit)
           
 void setOrder(SortParameters.Order order)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSortParameters

public DefaultSortParameters()
Constructs a new DefaultSortParameters instance.


DefaultSortParameters

public DefaultSortParameters(SortParameters.Range limit,
                             SortParameters.Order order,
                             Boolean alphabetic)
Constructs a new DefaultSortParameters instance.

Parameters:
limit -
order -
alphabetic -

DefaultSortParameters

public DefaultSortParameters(byte[] byPattern,
                             SortParameters.Range limit,
                             byte[][] getPattern,
                             SortParameters.Order order,
                             Boolean alphabetic)
Constructs a new DefaultSortParameters instance.

Parameters:
byPattern -
limit -
getPattern -
order -
alphabetic -
Method Detail

getByPattern

public byte[] getByPattern()
Description copied from interface: SortParameters
Returns the pattern (if set) for sorting by external keys (BY). Can be null if nothing is specified.

Specified by:
getByPattern in interface SortParameters
Returns:
BY pattern.

setByPattern

public void setByPattern(byte[] byPattern)

getLimit

public SortParameters.Range getLimit()
Description copied from interface: SortParameters
Returns the sorting limit (range or pagination). Can be null if nothing is specified.

Specified by:
getLimit in interface SortParameters
Returns:
sorting limit/range

setLimit

public void setLimit(SortParameters.Range limit)

getGetPattern

public byte[][] getGetPattern()
Description copied from interface: SortParameters
Returns the pattern (if set) for retrieving external keys (GET). Can be null if nothing is specified.

Specified by:
getGetPattern in interface SortParameters
Returns:
GET pattern.

addGetPattern

public void addGetPattern(byte[] gPattern)

setGetPattern

public void setGetPattern(byte[][] gPattern)

getOrder

public SortParameters.Order getOrder()
Description copied from interface: SortParameters
Returns the sorting order. Can be null if nothing is specified.

Specified by:
getOrder in interface SortParameters
Returns:
sorting order

setOrder

public void setOrder(SortParameters.Order order)

isAlphabetic

public Boolean isAlphabetic()
Description copied from interface: SortParameters
Indicates if the sorting is numeric (default) or alphabetical (lexicographical). Can be null if nothing is specified.

Specified by:
isAlphabetic in interface SortParameters
Returns:
the type of sorting

setAlphabetic

public void setAlphabetic(Boolean alphabetic)

order

public DefaultSortParameters order(SortParameters.Order order)

alpha

public DefaultSortParameters alpha()

asc

public DefaultSortParameters asc()

desc

public DefaultSortParameters desc()

numeric

public DefaultSortParameters numeric()

get

public DefaultSortParameters get(byte[] pattern)

by

public DefaultSortParameters by(byte[] pattern)

limit

public DefaultSortParameters limit(long start,
                                   long count)

Spring Data Key-Value

Copyright © 2010-2011 SpringSource. All Rights Reserved.