mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-20 07:22:32 +00:00
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:
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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user