private void addPortIfValid ( Map < String , Integer > map , String key , String port ) { if ( StringUtils . isNotBlank ( port ) ) { String t = port . trim ( ) ; if ( t . matches ( NUMBER_REGEX ) ) { map . put ( key , Integer . parseInt ( t ) ) ; } } }
Adds a port to the list .