Search in sources :

Example 1 with NxmNxNshc4Grouping

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

the class Nshc4Convertor method convert.

@Override
public MatchEntry convert(Extension extension) {
    Optional<NxmNxNshc4Grouping> matchGrouping = MatchUtil.NSC4_RESOLVER.getExtension(extension);
    if (!matchGrouping.isPresent()) {
        throw new CodecPreconditionException(extension);
    }
    Long value = matchGrouping.get().getNxmNxNshc4().getValue();
    Nshc4CaseValueBuilder nsc4CaseValueBuilder = new Nshc4CaseValueBuilder();
    nsc4CaseValueBuilder.setNshc4Values(new Nshc4ValuesBuilder().setNshc(value).build());
    return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNshc4.class, Nxm1Class.class, nsc4CaseValueBuilder.build()).build();
}
Also used : Nxm1Class(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class) NxmNxNshc4(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.nshc._4.grouping.NxmNxNshc4) Nshc4ValuesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.nshc._4.grouping.Nshc4ValuesBuilder) CodecPreconditionException(org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException) Nshc4CaseValueBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.Nshc4CaseValueBuilder) NxmNxNshc4Grouping(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxNshc4Grouping)

Aggregations

CodecPreconditionException (org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException)1 Nxm1Class (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class)1 Nshc4ValuesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.nshc._4.grouping.Nshc4ValuesBuilder)1 Nshc4CaseValueBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.Nshc4CaseValueBuilder)1 NxmNxNshc4Grouping (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxNshc4Grouping)1 NxmNxNshc4 (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.nshc._4.grouping.NxmNxNshc4)1