Package org.idevlab.rjc

Examples of org.idevlab.rjc.SortingParams


  }

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

    SortingParams sortParams = RjcUtils.convertSortParams(params);
    final String stringKey = RjcUtils.decode(key);

    try {
      if (isPipelined()) {
        if (sortParams != null) {
View Full Code Here


  }

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

    SortingParams sortParams = RjcUtils.convertSortParams(params);
    final String stringKey = RjcUtils.decode(key);
    final String stringSortKey = RjcUtils.decode(sortKey);

    try {
      if (isPipelined()) {
View Full Code Here

    }
    return DecodeUtils.convertToList(keys);
  }

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

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

      byte[] byPattern = params.getByPattern();
      if (byPattern != null) {
        rjcSort.by(DecodeUtils.decode(byPattern));
      }
      byte[][] getPattern = params.getGetPattern();

      if (getPattern != null && getPattern.length > 0) {
        for (byte[] bs : getPattern) {
          rjcSort.get(DecodeUtils.decode(bs));
        }
      }
      Range limit = params.getLimit();
      if (limit != null) {
        rjcSort.limit((int) limit.getStart(), (int) limit.getCount());
      }
      Order order = params.getOrder();
      if (order != null && order.equals(Order.DESC)) {
        rjcSort.desc();
      }
      Boolean isAlpha = params.isAlphabetic();
      if (isAlpha != null && isAlpha) {
        rjcSort.alpha();
      }
    }
    return rjcSort;
  }
View Full Code Here

TOP

Related Classes of org.idevlab.rjc.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.