0
如何將List轉換爲GroupMatcher?如何將列表<String>轉換爲GroupMatcher <JobKey>
我的代碼就像這樣。
List<String> jobGroupNames = scheduler.getJobGroupNames();
現在我要檢查
for (GroupMatcher<JobKey> jobGroup : jobGroupNames) {
}
這裏jobGroupNames是列表,所以我得到這個錯誤
Type mismatch: cannot convert from element type String to GroupMatcher<JobKey>
試圖讓GorupMatcher像'GroupMatcher.groupEquals( jobGroupName)''for scheduler.getJobGroupNames()' –
它不起作用,'List'參數不適用於'groupEquals )' –
zeji
因爲你做錯了。嘗試閱讀如何迭代列表。 http://crunchify.com/how-to-iterate-through-java-list-4-way-to-iterate-through-loop/ –