Nicira extensions in OpenFlowJava library
[openflowjava.git] / openflow-extension-nicira / src / main / java / org / opendaylight / openflowjava / nx / codec / match / Reg4Codec.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.extension.nicira.match.rev140421.NxmNxReg4;
8 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
9 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Nxm1Class;
10
11 public class Reg4Codec extends AbstractRegCodec {
12
13     private static final int NXM_FIELD_CODE = 4;
14     public static final MatchEntrySerializerKey<Nxm1Class, NxmNxReg4> SERIALIZER_KEY = new MatchEntrySerializerKey<>(
15             EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg4.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 NxmNxReg4.class;
27     }
28
29 }