本文整理汇总了Java中org.onosproject.pcep.api.PcepTunnel.PathType类的典型用法代码示例。如果您正苦于以下问题:Java PathType类的具体用法?Java PathType怎么用?Java PathType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PathType类属于org.onosproject.pcep.api.PcepTunnel包,在下文中一共展示了PathType类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPath
import org.onosproject.pcep.api.PcepTunnel.PathType; //导入依赖的package包/类
private Path createPath(List<PcepHopNodeDescription> hopList,
PathType pathtype, PathState pathState) {
if (hopList == null || hopList.size() == 0) {
return null;
}
List<Link> links = new ArrayList<>();
for (int i = 1; i < hopList.size() - 1; i = i + 2) {
links.add(link(hopList.get(i).getDeviceId(), hopList.get(i)
.getPortNum(), hopList.get(i + 1).getDeviceId(), hopList
.get(i + 1).getPortNum()));
}
int hopNum = hopList.size() - 2;
DefaultAnnotations extendAnnotations = DefaultAnnotations.builder()
.set("pathNum", String.valueOf(hopNum))
.set("pathState", String.valueOf(pathState))
.set("pathType", String.valueOf(pathtype)).build();
return new DefaultPath(id(), links, hopNum, extendAnnotations);
}
示例2: createPath
import org.onosproject.pcep.api.PcepTunnel.PathType; //导入依赖的package包/类
private Path createPath(List<PcepHopNodeDescription> hopList,
PathType pathtype, PathState pathState) {
if (hopList == null || hopList.isEmpty()) {
return null;
}
List<Link> links = new ArrayList<>();
for (int i = 1; i < hopList.size() - 1; i = i + 2) {
links.add(link(hopList.get(i).getDeviceId(), hopList.get(i)
.getPortNum(), hopList.get(i + 1).getDeviceId(), hopList
.get(i + 1).getPortNum()));
}
int hopNum = hopList.size() - 2;
DefaultAnnotations extendAnnotations = DefaultAnnotations.builder()
.set("pathNum", String.valueOf(hopNum))
.set("pathState", String.valueOf(pathState))
.set("pathType", String.valueOf(pathtype)).build();
return new DefaultPath(id(), links, hopNum, extendAnnotations);
}