public Option choices ( String ... choices ) throws RequiredParametersException { if ( this . defaultValue != null ) { if ( Arrays . asList ( choices ) . contains ( defaultValue ) ) { Collections . addAll ( this . choices , choices ) ; } else { throw new RequiredParametersException ( "Valid values for option " + this . longName + " do not contain defined default value " + defaultValue ) ; } } else { Collections . addAll ( this . choices , choices ) ; } return this ; }
Restrict the list of possible values of the parameter .