本文整理汇总了Java中org.jooq.lambda.Unchecked.supplier方法的典型用法代码示例。如果您正苦于以下问题:Java Unchecked.supplier方法的具体用法?Java Unchecked.supplier怎么用?Java Unchecked.supplier使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jooq.lambda.Unchecked
的用法示例。
在下文中一共展示了Unchecked.supplier方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: calculateStatsForAppIdSelector
import org.jooq.lambda.Unchecked; //导入方法依赖的package包/类
private LogicalFlowStatistics calculateStatsForAppIdSelector(IdSelectionOptions options) {
checkNotNull(options, "options cannot be null");
Select<Record1<Long>> appIdSelector = appIdSelectorFactory.apply(options);
Future<List<TallyPack<String>>> dataTypeCounts = dbExecutorPool.submit(() ->
FunctionUtilities.time("DFS.dataTypes",
() -> logicalFlowStatsDao.tallyDataTypesByAppIdSelector(appIdSelector)));
Future<LogicalFlowMeasures> appCounts = dbExecutorPool.submit(() ->
FunctionUtilities.time("DFS.appCounts",
() -> logicalFlowStatsDao.countDistinctAppInvolvementByAppIdSelector(appIdSelector)));
Future<LogicalFlowMeasures> flowCounts = dbExecutorPool.submit(() ->
FunctionUtilities.time("DFS.flowCounts",
() -> logicalFlowStatsDao.countDistinctFlowInvolvementByAppIdSelector(appIdSelector)));
Supplier<ImmutableLogicalFlowStatistics> statSupplier = Unchecked.supplier(() -> ImmutableLogicalFlowStatistics.builder()
.dataTypeCounts(dataTypeCounts.get())
.appCounts(appCounts.get())
.flowCounts(flowCounts.get())
.build());
return statSupplier.get();
}
示例2: countDistinctAppInvolvementByAppIdSelector
import org.jooq.lambda.Unchecked; //导入方法依赖的package包/类
public LogicalFlowMeasures countDistinctAppInvolvementByAppIdSelector(Select<Record1<Long>> appIdSelector) {
checkNotNull(appIdSelector, "appIdSelector cannot be null");
Select<Record1<Integer>> inAppCounter = countDistinctApps(
appIdSelector,
lf.TARGET_ENTITY_ID,
lf.SOURCE_ENTITY_ID
);
Select<Record1<Integer>> outAppCounter = countDistinctApps(
appIdSelector,
lf.SOURCE_ENTITY_ID,
lf.TARGET_ENTITY_ID
);
Select<Record1<Integer>> intraAppCounter = dsl
.select(count())
.from(APPLICATION)
.where(dsl.renderInlined(APPLICATION.ID.in(appIdSelector)));
Future<Integer> inAppCount = dbExecutorPool.submit(() -> inAppCounter.fetchOne().value1());
Future<Integer> outAppCount = dbExecutorPool.submit(() -> outAppCounter.fetchOne().value1());
Future<Integer> intraAppCount = dbExecutorPool.submit(() -> intraAppCounter.fetchOne().value1());
Supplier<ImmutableLogicalFlowMeasures> appCountSupplier = Unchecked.supplier(() -> ImmutableLogicalFlowMeasures.builder()
.inbound(inAppCount.get())
.outbound(outAppCount.get())
.intra(intraAppCount.get())
.build());
return appCountSupplier.get();
}
示例3: unchecked
import org.jooq.lambda.Unchecked; //导入方法依赖的package包/类
/**
* @see {@link Unchecked#supplier(CheckedSupplier)}
*/
static <T> Supplier<T> unchecked(CheckedSupplier<T> supplier) {
return Unchecked.supplier(supplier);
}