use of org.opendaylight.yangtools.yang.data.api.schema.ContainerNode in project bgpcep by opendaylight.
the class NodeNlriParser method serializeIsisPseudoNode.
private static IsisPseudonodeCase serializeIsisPseudoNode(final ContainerNode pseudoIsisNode) {
final IsIsRouterIdentifierBuilder isisRouterId = new IsIsRouterIdentifierBuilder();
if (pseudoIsisNode.getChild(ISIS_ROUTER_NID).isPresent()) {
final ContainerNode isisRouterNid = (ContainerNode) pseudoIsisNode.getChild(ISIS_ROUTER_NID).get();
if (isisRouterNid.getChild(ISO_SYSTEM_NID).isPresent()) {
isisRouterId.setIsoSystemId(new IsoSystemIdentifier((byte[]) isisRouterNid.getChild(ISO_SYSTEM_NID).get().getValue()));
}
}
final IsisPseudonodeBuilder nodeBuilder = new IsisPseudonodeBuilder();
nodeBuilder.setIsIsRouterIdentifier(isisRouterId.build());
if (pseudoIsisNode.getChild(PSN_NID).isPresent()) {
nodeBuilder.setPsn((Short) pseudoIsisNode.getChild(PSN_NID).get().getValue());
} else {
nodeBuilder.setPsn((short) 0);
}
return new IsisPseudonodeCaseBuilder().setIsisPseudonode(nodeBuilder.build()).build();
}
Aggregations