InstanceRuntime.java 文件源码

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

项目:hashsdn-controller 作者:
/**
 * Finds all children runtime beans, same properties and values as current root
 * + any number of additional properties.
 */
private Set<ObjectName> findChildren(ObjectName innerRootBean, Set<ObjectName> childRbeOns) {
    final Map<String, String> wantedProperties = innerRootBean.getKeyPropertyList();

    return Sets.newHashSet(Collections2.filter(childRbeOns, on -> {
        Map<String, String> localProperties = on.getKeyPropertyList();
        for (Entry<String, String> propertyEntry : wantedProperties.entrySet()) {
            if (!localProperties.containsKey(propertyEntry.getKey())) {
                return false;
            }
            if (!localProperties.get(propertyEntry.getKey()).equals(propertyEntry.getValue())) {
                return false;
            }
            if (localProperties.size() <= wantedProperties.size()) {
                return false;
            }
        }
        return true;
    }));
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号