本文整理汇总了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();
}
示例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;
}