Removed checkstyle warnings.
[bgpcep.git] / pcep / spi / src / main / java / org / opendaylight / protocol / pcep / spi / pojo / SimpleTlvRegistry.java
index 8a585d2987ff619b9818908d5dd1dc0fe5e71bfe..d4b57c3be60a2fac302f968dce31573b4922dc55 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.pcep.spi.pojo;
 
+import com.google.common.base.Preconditions;
+
 import io.netty.buffer.ByteBuf;
 
 import org.opendaylight.protocol.concepts.HandlerRegistry;
@@ -18,40 +20,38 @@ import org.opendaylight.protocol.util.Values;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Tlv;
 import org.opendaylight.yangtools.yang.binding.DataContainer;
 
-import com.google.common.base.Preconditions;
-
 /**
  *
  */
 public final class SimpleTlvRegistry implements TlvRegistry {
 
-       private final HandlerRegistry<DataContainer, TlvParser, TlvSerializer> handlers = new HandlerRegistry<>();
-
-       public AutoCloseable registerTlvParser(final int tlvType, final TlvParser parser) {
-               Preconditions.checkArgument(tlvType >= 0 && tlvType < Values.UNSIGNED_SHORT_MAX_VALUE);
-               return this.handlers.registerParser(tlvType, parser);
-       }
-
-       public AutoCloseable registerTlvSerializer(final Class<? extends Tlv> tlvClass, final TlvSerializer serializer) {
-               return this.handlers.registerSerializer(tlvClass, serializer);
-       }
-
-       @Override
-       public Tlv parseTlv(final int type, final ByteBuf buffer) throws PCEPDeserializerException {
-               Preconditions.checkArgument(type >= 0 && type <= Values.UNSIGNED_SHORT_MAX_VALUE);
-               final TlvParser parser = this.handlers.getParser(type);
-               if (parser == null) {
-                       return null;
-               }
-               return parser.parseTlv(buffer);
-       }
-
-       @Override
-       public byte[] serializeTlv(final Tlv tlv) {
-               final TlvSerializer serializer = this.handlers.getSerializer(tlv.getImplementedInterface());
-               if (serializer == null) {
-                       return null;
-               }
-               return serializer.serializeTlv(tlv);
-       }
+    private final HandlerRegistry<DataContainer, TlvParser, TlvSerializer> handlers = new HandlerRegistry<>();
+
+    public AutoCloseable registerTlvParser(final int tlvType, final TlvParser parser) {
+        Preconditions.checkArgument(tlvType >= 0 && tlvType < Values.UNSIGNED_SHORT_MAX_VALUE);
+        return this.handlers.registerParser(tlvType, parser);
+    }
+
+    public AutoCloseable registerTlvSerializer(final Class<? extends Tlv> tlvClass, final TlvSerializer serializer) {
+        return this.handlers.registerSerializer(tlvClass, serializer);
+    }
+
+    @Override
+    public Tlv parseTlv(final int type, final ByteBuf buffer) throws PCEPDeserializerException {
+        Preconditions.checkArgument(type >= 0 && type <= Values.UNSIGNED_SHORT_MAX_VALUE);
+        final TlvParser parser = this.handlers.getParser(type);
+        if (parser == null) {
+            return null;
+        }
+        return parser.parseTlv(buffer);
+    }
+
+    @Override
+    public byte[] serializeTlv(final Tlv tlv) {
+        final TlvSerializer serializer = this.handlers.getSerializer(tlv.getImplementedInterface());
+        if (serializer == null) {
+            return null;
+        }
+        return serializer.serializeTlv(tlv);
+    }
 }