public static int getConfKey ( String ... args ) { switch ( args . length ) { case 0 : printHelp ( "Missing argument." ) ; return 1 ; case 1 : String varName = args [ 0 ] . trim ( ) ; String propertyName = ENV_VIOLATORS . getOrDefault ( varName , varName . toLowerCase ( ) . replace ( "_" , "." ) ) ; if ( ! PropertyKey . isValid ( propertyName ) ) { printHelp ( String . format ( "%s is not a valid configuration key" , propertyName ) ) ; return 1 ; } PropertyKey key = PropertyKey . fromString ( propertyName ) ; System . out . println ( key . getName ( ) ) ; break ; default : printHelp ( "More arguments than expected" ) ; return 1 ; } return 0 ; }
Implements get configuration key .