This commit is contained in:
Redkale
2019-10-28 11:59:23 +08:00
parent fd862ed6c6
commit 5790135add

View File

@@ -85,6 +85,13 @@ public interface Creator<T> {
creatorCacheMap.put(Stream.class, (params) -> new ArrayList<>().stream());
creatorCacheMap.put(ConcurrentHashMap.class, (params) -> new ConcurrentHashMap<>());
creatorCacheMap.put(CompletableFuture.class, (params) -> new CompletableFuture<>());
creatorCacheMap.put(Map.Entry.class, new Creator<Map.Entry>() {
@Override
@ConstructorParameters({"key", "value"})
public AbstractMap.SimpleEntry create(Object... params) {
return new AbstractMap.SimpleEntry(params[0], params[1]);
}
});
creatorCacheMap.put(AbstractMap.SimpleEntry.class, new Creator<AbstractMap.SimpleEntry>() {
@Override
@ConstructorParameters({"key", "value"})