用Set类判断Map里key是否存在的示例代码
发布时间:2016-12-28 来源:查字典编辑
摘要:复制代码代码如下:publicbooleancheckSGDLookPre(StringsgdBrId,Ce_sysusercuser){i...
复制代码 代码如下:
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);
}