private < T > T getEnvConfig ( Map < String , ? > configs , String key , Class < T > type ) { if ( configs . containsKey ( key ) ) { Object config = configs . get ( key ) ; if ( type . isAssignableFrom ( config . getClass ( ) ) ) { return type . cast ( config ) ; } } return null ; }
Helper method used to retrieve the value from a given map if it matches the type specified .