private List < String > extractList ( Map < String , String > pAgentConfig , String pKey ) { List < String > ret = new ArrayList < String > ( ) ; if ( pAgentConfig . containsKey ( pKey ) ) { ret . add ( pAgentConfig . get ( pKey ) ) ; } int idx = 1 ; String keyIdx = pKey + "." + idx ; while ( pAgentConfig . containsKey ( keyIdx ) ) { ret . add ( pAgentConfig . get ( keyIdx ) ) ; keyIdx = pKey + "." + ++ idx ; } return ret . size ( ) > 0 ? ret : null ; }
More elements can be given with . 1 . 2 ... added .