Package com.lambdaworks.redis

Examples of com.lambdaworks.redis.SortArgs


    }
    return tuples;
  }

  static SortArgs sort(SortParameters params) {
    SortArgs args = new SortArgs();

    if (params == null) {
      return args;
    }

    if (params.getByPattern() != null) {
      args.by(new String(params.getByPattern(), Charsets.ASCII));
    }

    if (params.getLimit() != null) {
      args.limit(params.getLimit().getStart(), params.getLimit().getCount());
    }

    if (params.getGetPattern() != null) {
      byte[][] pattern = params.getGetPattern();
      for (byte[] bs : pattern) {
        args.get(new String(bs, Charsets.ASCII));
      }
    }

    if (params.getOrder() != null) {
      if (params.getOrder() == Order.ASC) {
        args.asc();
      } else {
        args.desc();
      }
    }

    Boolean isAlpha = params.isAlphabetic();
    if (isAlpha != null && isAlpha) {
      args.alpha();
    }
    return args;
  }
View Full Code Here


  public static Converter<List<byte[]>, Map<byte[], byte[]>> bytesListToMapConverter() {
    return BYTES_LIST_TO_MAP;
  }

  public static SortArgs toSortArgs(SortParameters params) {
    SortArgs args = new SortArgs();
    if (params == null) {
      return args;
    }
    if (params.getByPattern() != null) {
      args.by(new String(params.getByPattern(), Charsets.ASCII));
    }
    if (params.getLimit() != null) {
      args.limit(params.getLimit().getStart(), params.getLimit().getCount());
    }
    if (params.getGetPattern() != null) {
      byte[][] pattern = params.getGetPattern();
      for (byte[] bs : pattern) {
        args.get(new String(bs, Charsets.ASCII));
      }
    }
    if (params.getOrder() != null) {
      if (params.getOrder() == Order.ASC) {
        args.asc();
      } else {
        args.desc();
      }
    }
    Boolean isAlpha = params.isAlphabetic();
    if (isAlpha != null && isAlpha) {
      args.alpha();
    }
    return args;
  }
View Full Code Here

    return Collections.emptyList();
  }

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

    SortArgs args = LettuceConverters.toSortArgs(params);

    try {
      if (isPipelined()) {
        pipeline(new LettuceResult(getAsyncConnection().sort(key, args)));
        return null;
View Full Code Here

    }
  }

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

    SortArgs args = LettuceConverters.toSortArgs(params);

    try {
      if (isPipelined()) {
        pipeline(new LettuceResult(getAsyncConnection().sortStore(key, args, sortKey)));
        return null;
View Full Code Here

TOP

Related Classes of com.lambdaworks.redis.SortArgs

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.