Search in sources :

Example 1 with NxmOfEthTypeGrouping

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

the class EthTypeConvertor method convert.

@Override
public MatchEntry convert(Extension extension) {
    Optional<NxmOfEthTypeGrouping> matchGrouping = MatchUtil.ETH_TYPE_RESOLVER.getExtension(extension);
    if (!matchGrouping.isPresent()) {
        throw new CodecPreconditionException(extension);
    }
    Integer value = matchGrouping.get().getNxmOfEthType().getValue();
    EthTypeCaseValueBuilder ethTypeCaseValueBuilder = new EthTypeCaseValueBuilder();
    ethTypeCaseValueBuilder.setEthTypeValues(new EthTypeValuesBuilder().setValue(value).build());
    return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfEthType.class, Nxm0Class.class, ethTypeCaseValueBuilder.build()).build();
}
Also used : NxmOfEthTypeGrouping(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmOfEthTypeGrouping) NxmOfEthType(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.of.eth.type.grouping.NxmOfEthType) CodecPreconditionException(org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException) EthTypeCaseValueBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.EthTypeCaseValueBuilder) EthTypeValuesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.of.match.eth.type.grouping.EthTypeValuesBuilder) Nxm0Class(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm0Class)

Aggregations

CodecPreconditionException (org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException)1 Nxm0Class (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm0Class)1 EthTypeValuesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.of.match.eth.type.grouping.EthTypeValuesBuilder)1 EthTypeCaseValueBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.EthTypeCaseValueBuilder)1 NxmOfEthTypeGrouping (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmOfEthTypeGrouping)1 NxmOfEthType (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.of.eth.type.grouping.NxmOfEthType)1