public final < T > T getOption ( String name ) { if ( arguments == null ) { throw new IllegalStateException ( "setArgs not called" ) ; } Object value = options . get ( name ) ; if ( value == null ) { Option opt = map . get ( name ) ; if ( opt == null ) { throw new IllegalArgumentException ( "option " + name + " not found" ) ; } if ( opt . defValue != null ) { return ( T ) opt . defValue ; } if ( ! opt . mandatory ) { return null ; } throw new IllegalArgumentException ( name + " not found" ) ; } return ( T ) value ; }
Return named option value .