added extra constructor

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@16858 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
huybrechts committed 2009-04-05 12:50:00 +00:00
1 parent c2f46f3438
commit c959186b31
1 file changed
+9
@@ -6,6 +6,7 @@ import org.apache.commons.lang.StringUtils;
import net.sf.json.JSONObject;
import hudson.Extension;
import java.util.ArrayList;
import java.util.List;
import java.util.Arrays;
@@ -24,6 +25,14 @@ public class ChoiceParameterDefinition extends ParameterDefinition {
}
}
public ChoiceParameterDefinition(String name, String[] choices, String description) {
super(name, description);
this.choices = new ArrayList<String>(Arrays.asList(choices));
if (this.choices.isEmpty()) {
throw new IllegalArgumentException("No choices found");
}
}
public List<String> getChoices() {
return choices;
}