当前位置: 首页>>代码示例>>Java>>正文


Java ProviderId.equals方法代码示例

本文整理汇总了Java中org.onosproject.net.provider.ProviderId.equals方法的典型用法代码示例。如果您正苦于以下问题:Java ProviderId.equals方法的具体用法?Java ProviderId.equals怎么用?Java ProviderId.equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.onosproject.net.provider.ProviderId的用法示例。


在下文中一共展示了ProviderId.equals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: composeLink

import org.onosproject.net.provider.ProviderId; //导入方法依赖的package包/类
private Link composeLink(Map<ProviderId, LinkDescription> descs) {
    ProviderId primary = getBaseProviderId(descs);
    LinkDescription base = descs.get(verifyNotNull(primary));

    ConnectPoint src = base.src();
    ConnectPoint dst = base.dst();
    Type type = base.type();
    DefaultAnnotations annotations = DefaultAnnotations.builder().build();
    annotations = merge(annotations, base.annotations());

    for (Entry<ProviderId, LinkDescription> e : descs.entrySet()) {
        if (primary.equals(e.getKey())) {
            continue;
        }

        // TODO: should keep track of Description timestamp
        // and only merge conflicting keys when timestamp is newer
        // Currently assuming there will never be a key conflict between
        // providers

        // annotation merging. not so efficient, should revisit later
        annotations = merge(annotations, e.getValue().annotations());
    }

    boolean isDurable = Objects.equals(annotations.value(AnnotationKeys.DURABLE), "true");
    return DefaultLink.builder()
            .providerId(primary)
            .src(src)
            .dst(dst)
            .type(type)
            .state(ACTIVE)
            .isExpected(isDurable)
            .annotations(annotations)
            .build();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:36,代码来源:SimpleLinkStore.java

示例2: mergeAnnotations

import org.onosproject.net.provider.ProviderId; //导入方法依赖的package包/类
private DefaultAnnotations mergeAnnotations(DeviceId deviceId) {
    ProviderId primaryProviderId = getPrimaryProviderId(deviceId);
    DeviceDescription primaryDeviceDescription =
            deviceDescriptions.get(new DeviceKey(primaryProviderId, deviceId));
    DefaultAnnotations annotations = DefaultAnnotations.builder().build();
    annotations = merge(annotations, primaryDeviceDescription.annotations());
    for (ProviderId providerId : getAllProviders(deviceId)) {
        if (!providerId.equals(primaryProviderId)) {
            annotations = merge(annotations,
                                deviceDescriptions.get(new DeviceKey(providerId, deviceId)).annotations());
        }
    }
    return annotations;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:15,代码来源:ECDeviceStore.java


注:本文中的org.onosproject.net.provider.ProviderId.equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。