在 Java 中将对象转换为 Map
我有一段代码。
List<Bson> results = queryBuilder.createQuery(request, tableName, pivotValues);
Publisher<Employee> rows = getCollection().aggregate(results);
Flux.from(rows).map().collect(Collectors.toList());
在 map() 函数内部 - 我需要编写一个 lambda 表达式来将 Employee 对象转换为 Map
有人可以帮忙吗?
I have a piece of code.
List<Bson> results = queryBuilder.createQuery(request, tableName, pivotValues);
Publisher<Employee> rows = getCollection().aggregate(results);
Flux.from(rows).map().collect(Collectors.toList());
inside map() function - I need to write a lambda expression to convert the Employee object to Map<String, Object> - String Key is field name and Object is field value. Employee has fields id and name.
Can someone help on this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论