DeviceSetupRepository.java 文件源码

java
阅读 26 收藏 0 点赞 0 评论 0

项目:HomeWire-Server 作者:
public List<DeviceEntity> getDeviceEntitiesByType(String type) {
  Document query = new Document("type", type);

  List<DeviceEntity> result = new ArrayList<>();

  collection.find(query).forEach((Block<? super Document>) document -> {
    Short devId = document.getInteger("dev_id").shortValue();
    String category = document.getString("category");
    String name = document.getString("name");
    boolean isTrusted = document.getBoolean("isTrusted");

    result.add(new DeviceEntity(devId, name, category, type, isTrusted));
  });

  return result;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号