Merge "Upgrade ietf-{inet,yang}-types to 2013-07-15"
[openflowplugin.git] / extension / openflowjava-extension-nicira / src / main / java / org / opendaylight / openflowjava / nx / codec / match / Reg3Codec.java
1 /*
2  * Copyright (c) 2014, 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.openflowjava.nx.codec.match;
10
11 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
12 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
13 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
14 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg3;
18
19 public class Reg3Codec extends AbstractRegCodec {
20
21     private static final int NXM_FIELD_CODE = 3;
22     public static final MatchEntrySerializerKey<Nxm1Class, NxmNxReg3> SERIALIZER_KEY = new MatchEntrySerializerKey<>(
23             EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg3.class);
24     public static final MatchEntryDeserializerKey DESERIALIZER_KEY = new MatchEntryDeserializerKey(
25             EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, NXM_FIELD_CODE);
26
27     @Override
28     public int getNxmFieldCode() {
29         return NXM_FIELD_CODE;
30     }
31
32     @Override
33     public Class<? extends MatchField> getNxmField() {
34         return NxmNxReg3.class;
35     }
36
37 }