use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.path.attribute.link.state.attribute.PrefixAttributesCaseBuilder in project bgpcep by opendaylight.
the class PrefixAttributesParser method parsePrefixAttributes.
/**
* Parse prefix attributes.
*
* @param attributes key is the tlv type and value are the value bytes of the tlv
* @param protocolId to differentiate parsing methods
* @return {@link LinkStateAttribute}
*/
static LinkStateAttribute parsePrefixAttributes(final Multimap<Integer, ByteBuf> attributes, final ProtocolId protocolId) {
final PrefixAttributesBuilder builder = new PrefixAttributesBuilder();
final List<RouteTag> routeTags = new ArrayList<>();
final List<ExtendedRouteTag> exRouteTags = new ArrayList<>();
for (final Entry<Integer, ByteBuf> entry : attributes.entries()) {
final int key = entry.getKey();
final ByteBuf value = entry.getValue();
LOG.trace("Prefix attribute TLV {}", key);
parseAttribute(key, value, protocolId, builder, routeTags, exRouteTags);
}
LOG.trace("Finished parsing Prefix Attributes.");
builder.setRouteTags(routeTags);
builder.setExtendedTags(exRouteTags);
return new PrefixAttributesCaseBuilder().setPrefixAttributes(builder.build()).build();
}
Aggregations