我有这样的东西,我想得到一个字符串作为结果
List<Profile> profile;
String result = profile
.stream()
.filter(pro -> pro.getLastName().equals("test"))
.flatMap(pro -> pro.getCategory())
Run Code Online (Sandbox Code Playgroud)
getCategory() 应该返回一个字符串,但不确定我必须使用什么来返回字符串,我尝试了几件事,但都有效
任何想法?
谢谢