本文整理了Java中com.vaadin.flow.data.provider.Query.getFilter
方法的一些代码示例,展示了Query.getFilter
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getFilter
方法的具体详情如下:
包路径:com.vaadin.flow.data.provider.Query
类名称:Query
方法名:getFilter
[英]Gets the filter for items to fetch.
[中]获取要获取的项的筛选器。
代码示例来源:origin: com.vaadin/flow-data
private Stream<T> getFilteredStream(
Query<T, SerializablePredicate<T>> query) {
Stream<T> stream = backend.stream();
// Apply our own filters first so that query filters never see the items
// that would already have been filtered out
if (filter != null) {
stream = stream.filter(filter);
}
stream = query.getFilter().map(stream::filter).orElse(stream);
return stream;
}
代码示例来源:origin: com.vaadin/flow-data
@Override
protected F getFilter(Query<T, Q> query) {
Q queryFilter = query.getFilter().orElse(null);
if (configuredFilter == null && queryFilter == null) {
return null;
}
return combineFilters(queryFilter, configuredFilter);
}
代码示例来源:origin: com.vaadin/flow-data
/**
* Gets the filter converted from a query filter by the
* {@code filterConverter}.
*
* @param filterConverter
* callback that converts the filter in the query of the wrapped
* data provider into a filter supported by this data provider.
* Will only be called if the query contains a filter. Not
* <code>null</code>
* @param query
* a query with a filter to convert
* @return a converted filter, may be {@code null} if the query has no
* filter
*
* @param <C>
* the filter type that the wrapped data provider accepts;
* typically provided by a Component
*/
public static <T, C, F> F convertFilter(
SerializableFunction<C, F> filterConverter, Query<T, C> query) {
return query.getFilter().map(filterConverter).orElse(null);
}
}
代码示例来源:origin: com.vaadin/flow-data
private Query<T, F> mixInSortOrders(Query<T, F> query) {
if (sortOrders.isEmpty()) {
return query;
}
Set<String> sortedPropertyNames = query.getSortOrders().stream()
.map(SortOrder::getSorted).collect(Collectors.toSet());
List<QuerySortOrder> combinedSortOrders = Stream
.concat(query.getSortOrders().stream(),
sortOrders.stream()
.filter(order -> !sortedPropertyNames
.contains(order.getSorted())))
.collect(Collectors.toList());
return new Query<>(query.getOffset(), query.getLimit(),
combinedSortOrders, query.getInMemorySorting(),
query.getFilter().orElse(null));
}
代码示例来源:origin: com.holon-platform.vaadin/holon-vaadin-flow
query.getFilter().ifPresent(f -> {
QueryFilter filter = filterConverter.apply(f);
if (filter != null) {
内容来源于网络,如有侵权,请联系作者删除!