提交 c959186b 编写于 作者: H huybrechts

added extra constructor

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@16858 71c3de6d-444a-0410-be80-ed276b4c234a
上级 c2f46f34
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册