redis.clients.jedis
Class SortingParams

java.lang.Object
  extended by redis.clients.jedis.SortingParams

public class SortingParams
extends Object

Builder Class for SORT Parameters.


Constructor Summary
SortingParams()
           
 
Method Summary
 SortingParams alpha()
          Sort lexicographicaly.
 SortingParams asc()
          Get the Sorting in Ascending Order.
 SortingParams by(byte[] pattern)
          Sort by weight in keys.
 SortingParams by(String pattern)
          Sort by weight in keys.
 SortingParams desc()
          Get the Sorting in Descending Order.
 SortingParams get(byte[]... patterns)
          Retrieving external keys from the result of the search.
 SortingParams get(String... patterns)
          Retrieving external keys from the result of the search.
 Collection<byte[]> getParams()
           
 SortingParams limit(int start, int count)
          Limit the Numbers of returned Elements.
 SortingParams nosort()
          No sorting.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SortingParams

public SortingParams()
Method Detail

by

public SortingParams by(String pattern)
Sort by weight in keys.

Takes a pattern that is used in order to generate the key names of the weights used for sorting. Weight key names are obtained substituting the first occurrence of * with the actual value of the elements on the list.

The pattern for a normal key/value pair is "keyname*" and for a value in a hash "keyname*->fieldname".

Parameters:
pattern -
Returns:
the SortingParams Object

by

public SortingParams by(byte[] pattern)
Sort by weight in keys.

Takes a pattern that is used in order to generate the key names of the weights used for sorting. Weight key names are obtained substituting the first occurrence of * with the actual value of the elements on the list.

The pattern for a normal key/value pair is "keyname*" and for a value in a hash "keyname*->fieldname".

Parameters:
pattern -
Returns:
the SortingParams Object

nosort

public SortingParams nosort()
No sorting.

This is useful if you want to retrieve a external key (using GET) but you don't want the sorting overhead.

Returns:
the SortingParams Object

getParams

public Collection<byte[]> getParams()

desc

public SortingParams desc()
Get the Sorting in Descending Order.

Returns:
the sortingParams Object

asc

public SortingParams asc()
Get the Sorting in Ascending Order. This is the default order.

Returns:
the SortingParams Object

limit

public SortingParams limit(int start,
                           int count)
Limit the Numbers of returned Elements.

Parameters:
start - is zero based
count -
Returns:
the SortingParams Object

alpha

public SortingParams alpha()
Sort lexicographicaly. Note that Redis is utf-8 aware assuming you set the right value for the LC_COLLATE environment variable.

Returns:
the SortingParams Object

get

public SortingParams get(String... patterns)
Retrieving external keys from the result of the search.

Takes a pattern that is used in order to generate the key names of the result of sorting. The key names are obtained substituting the first occurrence of * with the actual value of the elements on the list.

The pattern for a normal key/value pair is "keyname*" and for a value in a hash "keyname*->fieldname".

To get the list itself use the char # as pattern.

Parameters:
patterns -
Returns:
the SortingParams Object

get

public SortingParams get(byte[]... patterns)
Retrieving external keys from the result of the search.

Takes a pattern that is used in order to generate the key names of the result of sorting. The key names are obtained substituting the first occurrence of * with the actual value of the elements on the list.

The pattern for a normal key/value pair is "keyname*" and for a value in a hash "keyname*->fieldname".

To get the list itself use the char # as pattern.

Parameters:
patterns -
Returns:
the SortingParams Object


Copyright © 2012. All Rights Reserved.