BUG-2794: incorporate openflowjava api changes to openflowplugin
[openflowplugin.git] / extension / openflowjava-extension-nicira / src / main / java / org / opendaylight / openflowjava / nx / codec / match / Reg3Codec.java
1 package org.opendaylight.openflowjava.nx.codec.match;
2
3 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
4 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
5 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
6 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
7 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
8 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class;
9 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg3;
10
11 public class Reg3Codec extends AbstractRegCodec {
12
13     private static final int NXM_FIELD_CODE = 3;
14     public static final MatchEntrySerializerKey<Nxm1Class, NxmNxReg3> SERIALIZER_KEY = new MatchEntrySerializerKey<>(
15             EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg3.class);
16     public static final MatchEntryDeserializerKey DESERIALIZER_KEY = new MatchEntryDeserializerKey(
17             EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, NXM_FIELD_CODE);
18
19     @Override
20     public int getNxmFieldCode() {
21         return NXM_FIELD_CODE;
22     }
23
24     @Override
25     public Class<? extends MatchField> getNxmField() {
26         return NxmNxReg3.class;
27     }
28
29 }