用Set类判断Map里key是否存在的示例代码
程序员文章站
2024-02-20 15:45:34
复制代码 代码如下:public boolean checksgdlookpre(string sgdbrid, ce_sysuser cuser) { &nbs...
复制代码 代码如下:
public boolean checksgdlookpre(string sgdbrid, ce_sysuser cuser) {
if (cuser.getsu_roleid() == 6) {
return true;
}
string[] strarray = cuser.getuserviewbranchs().split(",");
set<string> strset = new hashset<string>();
collectionutils.addall(strset, strarray);
return strset.contains(sgdbrid);
}
上一篇: 常用的adb命令