equal
deleted
inserted
replaced
96 * {@code choices}. |
96 * {@code choices}. |
97 */ |
97 */ |
98 public ChoiceCallback(String prompt, String[] choices, |
98 public ChoiceCallback(String prompt, String[] choices, |
99 int defaultChoice, boolean multipleSelectionsAllowed) { |
99 int defaultChoice, boolean multipleSelectionsAllowed) { |
100 |
100 |
101 if (prompt == null || prompt.length() == 0 || |
101 if (prompt == null || prompt.isEmpty() || |
102 choices == null || choices.length == 0 || |
102 choices == null || choices.length == 0 || |
103 defaultChoice < 0 || defaultChoice >= choices.length) |
103 defaultChoice < 0 || defaultChoice >= choices.length) |
104 throw new IllegalArgumentException(); |
104 throw new IllegalArgumentException(); |
105 |
105 |
106 for (int i = 0; i < choices.length; i++) { |
106 for (int i = 0; i < choices.length; i++) { |
107 if (choices[i] == null || choices[i].length() == 0) |
107 if (choices[i] == null || choices[i].isEmpty()) |
108 throw new IllegalArgumentException(); |
108 throw new IllegalArgumentException(); |
109 } |
109 } |
110 |
110 |
111 this.prompt = prompt; |
111 this.prompt = prompt; |
112 this.choices = choices; |
112 this.choices = choices; |