我不明白为什么会失败;
<form action="" method="">
<label>First Name <small>(required)</small></label>
<input name="firstname" type="text" class="form-control" placeholder="Andrew...">
<label>Last Name <small>(required)</small></label>
<input name="lastname" type="text" class="form-control" placeholder="Smith...">
<label>First Name <small>(required)</small></label>
<input name="cus-firstname" type="text" class="form-control" placeholder="John...">
<label>Last Name <small>(required)</small></label>
<input name="cus-lastname" type="text" class="form-control" placeholder="Williams...">
<label>Email <small>(required)</small></label>
<input name="cus-email" type="email" class="form-control" placeholder="John@paradime.com">
<input type="checkbox" name="design" value="design">
<p>The Original</p>
<input type="checkbox" name="design" value="design">
<p>Something Else</p>
<input type="checkbox" name="size" value="Small">
<input type="checkbox" name="size" value="Medium">
<input type="checkbox" name="size" value="Large">
<input type="checkbox" name="size" value="X-Large">
<input type="checkbox" name="size" value="XX-Large">
<label>Text</label><br>
<select name="quantity" class="form-control">
<option disabled="" selected="">- Quantity -</option>
<option value="one"> 1 </option>
<option value="two"> 2 </option>
<option value="three"> 3 </option>
<option value="four"> 4 </option>
<option value="five"> 5 </option>
<option value="six"> 6 </option>
<option value="seven"> 7 </option>
<option value="eight"> 8 </option>
<option value="nine"> 9 </option>
<option value="ten"> 10 </option>
</select>
<input type="text" class="form-control" placeholder="Price" name="price">
<label>Colour</label><br>
<select name="colour" class="form-control">
<option disabled="" selected="">- Colour -</option>
<option value="ANTIQ-CHERRY-RED"> ANTIQ CHERRY RED </option>
<option value="ANTIQUE-SAPPHIRE"> ANTIQUE SAPPHIRE </option>
</select>
<input type='button' name='finish' value='Finish'/>
</form>
错误消息:
Map<String, Boolean> iMap = Arrays.asList("1","2","3","4","5").stream()
.collect(Collectors.toMap(k->k, Boolean.TRUE));
任何帮助表示感谢。
答案 0 :(得分:3)
Collectors.toMap()
预计两个参数均为Function
。您尝试传递Boolean
。试试这个:
Collectors.toMap(k->k, k->Boolean.TRUE)