如何为私有HashMap编写字节预算代码 > hm;?

问题描述 投票:0回答:1

如果我写字节预算代码

.defineProperty("hm",TypeDescription.Generic.Builder.parameterizedType(HashMap.class, String.class, HashSet.class).build())

像这样,那么结果是private HashMap<String, HashSet> hm;

但是我的要求是private HashMap<String, HashSet<String>> hm;

java hashmap private hashset byte-buddy
1个回答
0
投票

构建器接受字节Buddy的TypeDefinition与类型文字一样多,因此您可以简单地嵌套构建的类型:

© www.soinside.com 2019 - 2024. All rights reserved.