public static Map < String , Criteria > constructCriteriaMap ( Collection < Criteria > aCriterias ) { if ( aCriterias == null ) return null ; Map < String , Criteria > map = new HashMap < String , Criteria > ( aCriterias . size ( ) ) ; Criteria criteria = null ; for ( Iterator < Criteria > i = aCriterias . iterator ( ) ; i . hasNext ( ) ; ) { criteria = ( Criteria ) i . next ( ) ; map . put ( criteria . getId ( ) , criteria ) ; } return map ; }
construct map for collection of criteria object wher the key is Criteria . getId