この行は:
List params = (List) hashMap.get(key);
新しいリストを作成しますか、それとも単にリストに追加しますか?
コードの使用方法は次のとおりです。
ParameterCache cache = ParameterCache.getInstance();
HashMap hashMap = cache.getAllParameters(ParameterCodeConstants.PARAMETER_DORF_REGION, false);
ArrayList regionIdList=new ArrayList();
Set keys = hashMap.keySet();
Iterator it = keys.iterator();
while (it.hasNext()) {
BigDecimal key = (BigDecimal) it.next();
List params = (List) hashMap.get(key);
if (params != null && params.size() > 0) {
ParameterDTO paramDTO = (ParameterDTO) params.get(0);
String textValue = paramDTO.getParameterTextValue();
if(textValue.equals(region_id)){
regionIdList.add(paramDTO.getRegion());
}
}
}