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


Java Unchecked.supplier方法代码示例

本文整理汇总了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();
}
 
开发者ID:khartec,项目名称:waltz,代码行数:26,代码来源:LogicalFlowService.java

示例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();
    }
 
开发者ID:khartec,项目名称:waltz,代码行数:34,代码来源:LogicalFlowStatsDao.java

示例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);
}
 
开发者ID:jOOQ,项目名称:jOOL,代码行数:7,代码来源:CheckedSupplier.java


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