'Optional.get()' without 'isPresent()' check

后端 未结 4 2301
无人共我
无人共我 2020-12-05 04:03

I have the following search code in Java:

return getTableViewController().getMe().getColumns().stream().filter($->Database.equalsColumnName($.getId(), col         


        
4条回答
  •  無奈伤痛
    2020-12-05 04:06

    my solution was to check it this way

    if(item.isPresent()){
      item.get().setId("1q2w3e4r5t6y")
    }
    

提交回复
热议问题