i69699
i69699
采纳率50%
2016-12-27 13:03

java小菜鸟求助(防尘符)

已采纳

java中的“::”什么意思
比如:
RouterFunction<?> route = route(GET("/person/{id}"),
request -> {
Mono person = Mono.justOrEmpty(request.pathVariable("id"))
.map(Integer::valueOf)
.then(repository::getPerson);
return Response.ok().body(fromPublisher(person, Person.class));
})
.and(route(GET("/person"),
request -> {
Flux people = repository.allPeople();
return Response.ok().body(fromPublisher(people, Person.class));
}))
.and(route(POST("/person"),
request -> {
Mono person = request.body(toMono(Person.class));
return Response.ok().build(repository.savePerson(person));
}));

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

相关推荐