当前位置: 首页>>代码示例>>Java>>正文


Java OrderComponent类代码示例

本文整理汇总了Java中com.threewks.gaetools.search.OrderComponent的典型用法代码示例。如果您正苦于以下问题:Java OrderComponent类的具体用法?Java OrderComponent怎么用?Java OrderComponent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OrderComponent类属于com.threewks.gaetools.search包,在下文中一共展示了OrderComponent类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buildSortOptions

import com.threewks.gaetools.search.OrderComponent; //导入依赖的package包/类
protected SortOptions.Builder buildSortOptions(List<OrderComponent> order) {
    SortOptions.Builder sortOptions = SortOptions.newBuilder();
    for (OrderComponent sort : order) {
        String fieldName = getEncodedFieldName(sort.getField());
        SortExpression.Builder expression = SortExpression.newBuilder().setExpression(fieldName);
        expression = expression.setDirection(sort.isAscending() ? SortExpression.SortDirection.ASCENDING : SortExpression.SortDirection.DESCENDING);
        IndexType indexType = metadata.getIndexType(sort.getField());
        if (IndexType.SmallDecimal == indexType || IndexType.BigDecimal == indexType) {
            expression = expression.setDefaultValueNumeric(sort.isDescending() ? IntLow : IntHigh);
        } else if (IndexType.Date == indexType) {
            expression = expression.setDefaultValueDate(sort.isDescending() ? DateLow : DateHigh);
        } else {
            expression = expression.setDefaultValue(sort.isDescending() ? StringLow : StringHigh);
        }
        sortOptions = sortOptions.addSortExpression(expression);
    }
    return sortOptions;
}
 
开发者ID:monPlan,项目名称:springboot-spwa-gae-demo,代码行数:19,代码来源:BaseGaeSearchService.java

示例2: SearchImpl

import com.threewks.gaetools.search.OrderComponent; //导入依赖的package包/类
protected SearchImpl(SearchExecutor<T, K, SearchImpl<T, K>> searchExecutor, List<QueryComponent> queryComponents, List<OrderComponent> sortOrder, Integer limit, Integer offset, Integer accuracy) {
    super();
    this.searchExecutor = searchExecutor;
    this.queryComponents = queryComponents;
    this.sortOrder = sortOrder;
    this.limit = limit;
    this.offset = offset;
    this.accuracy = accuracy;
}
 
开发者ID:monPlan,项目名称:springboot-spwa-gae-demo,代码行数:10,代码来源:SearchImpl.java

示例3: MockSearch

import com.threewks.gaetools.search.OrderComponent; //导入依赖的package包/类
protected MockSearch(SearchExecutor<T, K, MockSearch<T, K>> service, List<QueryComponent> queryComponents, List<OrderComponent> sort, Integer accuracy, Integer limit, Integer offset) {
    super();
    this.executor = service;
    this.queryComponents = queryComponents;
    this.sort = sort;
    this.accuracy = accuracy;
    this.limit = limit;
    this.offset = offset;
}
 
开发者ID:monPlan,项目名称:springboot-spwa-gae-demo,代码行数:10,代码来源:MockSearch.java

示例4: shouldApplyOrderOperation

import com.threewks.gaetools.search.OrderComponent; //导入依赖的package包/类
@Test
public void shouldApplyOrderOperation() {
    Search<LongTestEntity, Long> next = searchImpl.order("name", false);
    assertThat(next, not(sameInstance(search)));
    assertThat(searchImpl.order().isEmpty(), is(true));
    assertThat(delegate(searchImpl).order().isEmpty(), is(true));
    assertThat(next.order(), hasItems(OrderComponent.forField("name", false)));
    assertThat(delegate(next).order(), hasItems(OrderComponent.forField("name", false)));
}
 
开发者ID:monPlan,项目名称:springboot-spwa-gae-demo,代码行数:10,代码来源:SearchImplTest.java

示例5: order

import com.threewks.gaetools.search.OrderComponent; //导入依赖的package包/类
/**
 * @return the ordered series of sort operations that were specified on this search request
 */
@Override
public List<OrderComponent> order() {
    return sortOrder;
}
 
开发者ID:monPlan,项目名称:springboot-spwa-gae-demo,代码行数:8,代码来源:SearchImpl.java

示例6: createNewInstance

import com.threewks.gaetools.search.OrderComponent; //导入依赖的package包/类
protected Search<T, K> createNewInstance(List<QueryComponent> queryComponents, List<OrderComponent> sortOrder, Integer limit, Integer offset, Integer accuracy) {
    return new SearchImpl<>(searchExecutor, queryComponents, sortOrder, limit, offset, accuracy);
}
 
开发者ID:monPlan,项目名称:springboot-spwa-gae-demo,代码行数:4,代码来源:SearchImpl.java

示例7: order

import com.threewks.gaetools.search.OrderComponent; //导入依赖的package包/类
@Override
public List<OrderComponent> order() {
    return searchRequest.order();
}
 
开发者ID:monPlan,项目名称:springboot-spwa-gae-demo,代码行数:5,代码来源:SearchImpl.java

示例8: order

import com.threewks.gaetools.search.OrderComponent; //导入依赖的package包/类
@Override
public Search<T, K> order(String field, boolean ascending) {
    List<OrderComponent> sort = new ArrayList<>(this.sort);
    sort.add(OrderComponent.forField(field, ascending));
    return new MockSearch<>(executor, queryComponents, sort, accuracy, limit, offset);
}
 
开发者ID:monPlan,项目名称:springboot-spwa-gae-demo,代码行数:7,代码来源:MockSearch.java


注:本文中的com.threewks.gaetools.search.OrderComponent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。