private String getOptionalParameter ( String keyword , Map < String , String > parms ) { if ( ! parms . containsKey ( keyword ) ) { return null ; } String value = parms . get ( keyword ) ; if ( value == null ) { throw new ValidatorProcessUsageException ( "If parameter '" + keyword + "' is provided, it must have a value." ) ; } else { return value ; } }
Get the requested parameter from the map . If it s not there return null but if it s there with no value complain .