小编Prz*_*cki的帖子

在某些特定情况下,无法推断<R> map(函数<?super T,?extends R>)的类型参数

我在Sandbox.java文件中有以下类:

package sandbox;

import java.util.Arrays;
import java.util.Collection;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.stream.Collectors;

public class Sandbox {

    public static void main(String[] args) throws Exception {
        ExecutorService executor = Executors.newSingleThreadExecutor();
        Collection<String> s = Arrays.asList(1,2,4,100).stream()
                .map(i -> CompletableFuture
                        .supplyAsync(() -> Wrapper.of(i), executor)
                        .thenApply(d -> d.get().toString())
                        )
                .map(CompletableFuture::join)
                .collect(Collectors.toList());

        executor.shutdown();

        System.out.println(s);
    }
}

class Wrapper<T> {
    T t;

    private Wrapper(T t) {
        this.t = t;
    }

    public T get() {
        return t;
    }

    public static <T> Wrapper<T> of (T t) { …
Run Code Online (Sandbox Code Playgroud)

java eclipse compiler-errors eclipse-neon

10
推荐指数
1
解决办法
2万
查看次数

如何从IMEI中检索TAC?

问题很简单.我有IMEI,我想从中检索TAC.我该怎么做?如果我只有一个IMEI,有没有办法识别TAC应该有多少位?是否有必要明确知道设备的生产年份才能知道它?

mobile mobile-phones telecommunication imei

6
推荐指数
1
解决办法
1万
查看次数

Java中的Windows临时文件

如何在Windows中创建具有属性FILE_ATTRIBUTE_TEMPORARYFILE_FLAG_DELETE_ON_CLOSE使用Java设置的文件?

我确实希望我的文件只是内存文件。

精确地说:“退出时删除”机制令我不满意,因为我想避免这种情况,例如在应用程序崩溃的情况下,某些数据留在磁盘上。

java temporary-files java-io

5
推荐指数
1
解决办法
2667
查看次数

加密数据库中数据的安全应用程序的体系结构

我需要设计一个应用程序来保护数据库中的某些数据免受根攻击.这意味着,即使攻击者控制存储数据的机器或使用应用程序服务器加工,他也无法从数据库中读取一些关键业务数据.这是客户的要求.我将使用一些不对称算法加密数据,我需要一些好的想法,在哪里存储私钥,以便数据安全以及应用程序的可用性非常舒适?为简单起见,我们可以假设只使用一个密钥对.

java database architecture encryption cryptography

4
推荐指数
1
解决办法
560
查看次数

SQL Server 2008 Standard提供哪种加密机制?

正如我所见,TDE和EKM机制仅在企业版中可用.如何加密SQL Server 2008标准版中的表中的数据?

sql sql-server security encryption sql-server-2008

4
推荐指数
1
解决办法
4517
查看次数