Example code that USES the Set class to determine whether a key exists in a Map

  • 2020-04-01 02:43:17
  • OfStack


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);
 }

Related articles: