Search in sources :

Example 1 with NxmNxNshc3Grouping

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxNshc3Grouping in project openflowplugin by opendaylight.

the class Nshc3Convertor method convert.

@Override
public MatchEntry convert(Extension extension) {
    Optional<NxmNxNshc3Grouping> matchGrouping = MatchUtil.NSC3_RESOLVER.getExtension(extension);
    if (!matchGrouping.isPresent()) {
        throw new CodecPreconditionException(extension);
    }
    Long value = matchGrouping.get().getNxmNxNshc3().getValue();
    Nshc3CaseValueBuilder nsc3CaseValueBuilder = new Nshc3CaseValueBuilder();
    nsc3CaseValueBuilder.setNshc3Values(new Nshc3ValuesBuilder().setNshc(value).build());
    return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNshc3.class, Nxm1Class.class, nsc3CaseValueBuilder.build()).build();
}
Also used : Nxm1Class(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class) NxmNxNshc3(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.nshc._3.grouping.NxmNxNshc3) CodecPreconditionException(org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException) Nshc3ValuesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.nshc._3.grouping.Nshc3ValuesBuilder) Nshc3CaseValueBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.Nshc3CaseValueBuilder) NxmNxNshc3Grouping(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxNshc3Grouping)

Aggregations

CodecPreconditionException (org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException)1 Nxm1Class (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class)1 Nshc3ValuesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.nshc._3.grouping.Nshc3ValuesBuilder)1 Nshc3CaseValueBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.Nshc3CaseValueBuilder)1 NxmNxNshc3Grouping (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxNshc3Grouping)1 NxmNxNshc3 (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.nshc._3.grouping.NxmNxNshc3)1