ce972033408a9423698590830b4929f5e01abf26
[openflowjava.git] / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / serialization / match / AbstractOxmPortNumberSerializer.java
1 /*\r
2  * Copyright (c) 2013 Pantheon Technologies s.r.o. and others.  All rights reserved.\r
3  *\r
4  * This program and the accompanying materials are made available under the\r
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
6  * and is available at http://www.eclipse.org/legal/epl-v10.html\r
7  */\r
8 package org.opendaylight.openflowjava.protocol.impl.serialization.match;\r
9 \r
10 import io.netty.buffer.ByteBuf;\r
11 \r
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortNumberMatchEntry;\r
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;\r
14 \r
15 /**\r
16  * Parent for port(32-bit) based match entry serializers\r
17  * @author michal.polkorab\r
18  */\r
19 public abstract class AbstractOxmPortNumberSerializer extends AbstractOxmMatchEntrySerializer {\r
20 \r
21     @Override\r
22     public void serialize(MatchEntries entry, ByteBuf outBuffer) {\r
23         super.serialize(entry, outBuffer);\r
24         outBuffer.writeInt(entry.getAugmentation(PortNumberMatchEntry.class).getPortNumber().getValue().intValue());\r
25     }\r
26 }\r