public static final BiMap < String , String > getCallSetNameMapping ( Iterable < CallSet > callSets ) { BiMap < String , String > idToName = HashBiMap . create ( ) ; for ( CallSet callSet : callSets ) { // Dev Note: Be sure to keep this map loading as id -> name since it ensures that // the values are unique. idToName . put ( callSet . getId ( ) , callSet . getName ( ) ) ; } return idToName . inverse ( ) ; }
Create a bi - directional map of names to ids for a collection of callsets .