Search in sources :

Example 1 with StringInformation

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.string.informations.StringInformation in project bgpcep by opendaylight.

the class InitiationHandler method serializeTlvs.

private void serializeTlvs(final Tlvs tlvs, final ByteBuf output) {
    serializeTlv(tlvs.getNameTlv(), output);
    serializeTlv(tlvs.getDescriptionTlv(), output);
    if (tlvs.getStringInformation() != null) {
        for (final StringInformation stringInfo : tlvs.getStringInformation()) {
            if (stringInfo.getStringTlv() != null) {
                serializeTlv(stringInfo.getStringTlv(), output);
            }
        }
    }
}
Also used : StringInformation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.string.informations.StringInformation)

Example 2 with StringInformation

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.string.informations.StringInformation in project bgpcep by opendaylight.

the class PeerUpHandler method addTlv.

@Override
protected void addTlv(final InformationBuilder builder, final Tlv tlv) {
    if (tlv instanceof StringTlv) {
        final ImmutableList.Builder<StringInformation> stringInfoListBuilder = ImmutableList.builder();
        if (builder.getStringInformation() != null) {
            stringInfoListBuilder.addAll(builder.getStringInformation());
        }
        builder.setStringInformation(stringInfoListBuilder.add(new StringInformationBuilder().setStringTlv(new StringTlvBuilder((StringTlv) tlv).build()).build()).build());
    }
}
Also used : StringTlv(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.string.tlv.StringTlv) StringInformation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.string.informations.StringInformation) ImmutableList(com.google.common.collect.ImmutableList) StringInformationBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.string.informations.StringInformationBuilder) StringTlvBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.string.tlv.StringTlvBuilder)

Example 3 with StringInformation

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.string.informations.StringInformation in project bgpcep by opendaylight.

the class BmpRouterImpl method getStringInfo.

private static String getStringInfo(final List<StringInformation> info) {
    final StringBuilder builder = new StringBuilder();
    if (info != null) {
        for (final StringInformation string : info) {
            if (string.getStringTlv() != null) {
                builder.append(string.getStringTlv().getStringInfo());
                builder.append(";");
            }
        }
    }
    return builder.toString();
}
Also used : StringInformation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.string.informations.StringInformation)

Aggregations

StringInformation (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.string.informations.StringInformation)3 ImmutableList (com.google.common.collect.ImmutableList)1 StringInformationBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.string.informations.StringInformationBuilder)1 StringTlv (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.string.tlv.StringTlv)1 StringTlvBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.string.tlv.StringTlvBuilder)1