Package redis.clients.jedis

Examples of redis.clients.jedis.SortingParams


    txResults.add(result);
  }

  public List<byte[]> sort(byte[] key, SortParameters params) {

    SortingParams sortParams = JedisConverters.toSortingParams(params);

    try {
      if (isPipelined()) {
        if (sortParams != null) {
          pipeline(new JedisResult(pipeline.sort(key, sortParams)));
View Full Code Here


    }
  }

  public Long sort(byte[] key, SortParameters params, byte[] storeKey) {

    SortingParams sortParams = JedisConverters.toSortingParams(params);

    try {
      if (isPipelined()) {
        if (sortParams != null) {
          pipeline(new JedisResult(pipeline.sort(key, sortParams, storeKey)));
View Full Code Here

    }
    return result;
  }

  static SortingParams convertSortParams(SortParameters params) {
    SortingParams jedisParams = null;

    if (params != null) {
      jedisParams = new SortingParams();

      byte[] byPattern = params.getByPattern();
      if (byPattern != null) {
        jedisParams.by(params.getByPattern());
      }

      byte[][] getPattern = params.getGetPattern();
      if (getPattern != null) {
        jedisParams.get(getPattern);
      }

      Range limit = params.getLimit();
      if (limit != null) {
        jedisParams.limit((int) limit.getStart(), (int) limit.getCount());
      }
      Order order = params.getOrder();
      if (order != null && order.equals(Order.DESC)) {
        jedisParams.desc();
      }
      Boolean isAlpha = params.isAlphabetic();
      if (isAlpha != null && isAlpha) {
        jedisParams.alpha();
      }
    }

    return jedisParams;
  }
View Full Code Here

    }
    return result;
  }

  public static SortingParams toSortingParams(SortParameters params) {
    SortingParams jedisParams = null;
    if (params != null) {
      jedisParams = new SortingParams();
      byte[] byPattern = params.getByPattern();
      if (byPattern != null) {
        jedisParams.by(params.getByPattern());
      }
      byte[][] getPattern = params.getGetPattern();
      if (getPattern != null) {
        jedisParams.get(getPattern);
      }
      Range limit = params.getLimit();
      if (limit != null) {
        jedisParams.limit((int) limit.getStart(), (int) limit.getCount());
      }
      Order order = params.getOrder();
      if (order != null && order.equals(Order.DESC)) {
        jedisParams.desc();
      }
      Boolean isAlpha = params.isAlphabetic();
      if (isAlpha != null && isAlpha) {
        jedisParams.alpha();
      }
    }
    return jedisParams;
  }
View Full Code Here

TOP

Related Classes of redis.clients.jedis.SortingParams

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.