是否有等效于从位图中获取所有键(或逆)并将每个键与特殊字符连接为全新字符串的方法(无需遍历映射并手动构建它?
private static final BiMap<String, String> stuff = HashBiMap.create();
static {
stuff.put("S1", "STUFF_TYPE_1");
stuff.put("S2", "STUFF_TYPE_2");
stuff.put("S3", "STUFF_TYPE_3");
}
// The non-terminal <> is what I'm asking if something like exists either with bimap or some other container?
private static final String concateKeys = <stuff.getAllKeys().assignDelimiter("|").toString();>
然后 concateKeys 的值 = "S1|S2|S3"