-/*\r
- * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-\r
-package org.opendaylight.openflowjava.protocol.impl.util;\r
-\r
-import io.netty.buffer.ByteBuf;\r
-\r
-import java.util.List;\r
-\r
-import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderSerializer;\r
-import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;\r
-import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;\r
-import org.opendaylight.yangtools.yang.binding.DataObject;\r
-\r
-/**\r
- * Serializes list items and their headers\r
- * @author michal.polkorab\r
- * @param <E> \r
- */\r
-public abstract class ListSerializer {\r
-\r
- /**\r
- * Serializes item list\r
- * @param list list of items to be serialized\r
- * @param keyMaker creates key for registry lookup\r
- * @param registry stores serializers\r
- * @param outBuffer output buffer\r
- */\r
- public static <E extends DataObject> void serializeList(List<E> list,\r
- TypeKeyMaker<E> keyMaker, SerializerRegistry registry, ByteBuf outBuffer) {\r
- if (list != null) {\r
- for (E item : list) {\r
- OFSerializer<E> serializer = registry.getSerializer(keyMaker.make(item));\r
- serializer.serialize(item, outBuffer);\r
- }\r
- }\r
- }\r
-\r
- /**\r
- * Serializes headers of items in list\r
- * @param list list of items to be serialized\r
- * @param keyMaker creates key for registry lookup\r
- * @param registry stores serializers\r
- * @param outBuffer output buffer\r
- */\r
- public static <E extends DataObject> void serializeHeaderList(List<E> list,\r
- TypeKeyMaker<E> keyMaker, SerializerRegistry registry, ByteBuf outBuffer) {\r
- if (list != null) {\r
- for (E item : list) {\r
- HeaderSerializer<E> serializer = registry.getSerializer(keyMaker.make(item));\r
- serializer.serializeHeader(item, outBuffer);\r
- }\r
- }\r
- }\r
-\r
-}\r
+/*
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.impl.util;
+
+import io.netty.buffer.ByteBuf;
+
+import java.util.List;
+
+import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderSerializer;
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+
+/**
+ * Serializes list items and their headers
+ * @author michal.polkorab
+ * @param <E>
+ */
+public abstract class ListSerializer {
+
+ /**
+ * Serializes item list
+ * @param list list of items to be serialized
+ * @param keyMaker creates key for registry lookup
+ * @param registry stores serializers
+ * @param outBuffer output buffer
+ */
+ public static <E extends DataObject> void serializeList(List<E> list,
+ TypeKeyMaker<E> keyMaker, SerializerRegistry registry, ByteBuf outBuffer) {
+ if (list != null) {
+ for (E item : list) {
+ OFSerializer<E> serializer = registry.getSerializer(keyMaker.make(item));
+ serializer.serialize(item, outBuffer);
+ }
+ }
+ }
+
+ /**
+ * Serializes headers of items in list
+ * @param list list of items to be serialized
+ * @param keyMaker creates key for registry lookup
+ * @param registry stores serializers
+ * @param outBuffer output buffer
+ */
+ public static <E extends DataObject> void serializeHeaderList(List<E> list,
+ TypeKeyMaker<E> keyMaker, SerializerRegistry registry, ByteBuf outBuffer) {
+ if (list != null) {
+ for (E item : list) {
+ HeaderSerializer<E> serializer = registry.getSerializer(keyMaker.make(item));
+ serializer.serializeHeader(item, outBuffer);
+ }
+ }
+ }
+
+}