Remove EricMatchCodecs 20/94420/3
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 5 Jan 2021 22:43:07 +0000 (23:43 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Sun, 10 Jan 2021 10:52:10 +0000 (11:52 +0100)
This class hosts only two constants, move them to their respective
classes as singleton constants.

Change-Id: Iddac2dc01a7854f3461d5581d18b8530947179f8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
extension/openflowjava-extension-eric/src/main/java/org/opendaylight/openflowjava/eric/EricExtensionCodecRegistratorImpl.java
extension/openflowjava-extension-eric/src/main/java/org/opendaylight/openflowjava/eric/EricExtensionsRegistrator.java
extension/openflowjava-extension-eric/src/main/java/org/opendaylight/openflowjava/eric/codec/match/EricMatchCodecs.java [deleted file]
extension/openflowjava-extension-eric/src/main/java/org/opendaylight/openflowjava/eric/codec/match/Icmpv6NDOptionsTypeCodec.java
extension/openflowjava-extension-eric/src/main/java/org/opendaylight/openflowjava/eric/codec/match/Icmpv6NDReservedCodec.java

index ef21514c837d9c72a1ee415b6845e3474646b9d2..e187837425921eb949a0078e2e03d38d106bd801 100644 (file)
@@ -5,7 +5,6 @@
  * 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.eric;
 
 import java.util.List;
@@ -25,7 +24,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
  * Implementation of EricExtensionCodecRegistrator.
  */
 public class EricExtensionCodecRegistratorImpl implements EricExtensionCodecRegistrator {
-
     private final List<SwitchConnectionProvider> providers;
 
     public EricExtensionCodecRegistratorImpl(List<SwitchConnectionProvider> providers) {
@@ -72,7 +70,6 @@ public class EricExtensionCodecRegistratorImpl implements EricExtensionCodecRegi
 
     @Override
     public void close() {
-        // TODO Auto-generated method stub
+        // No-op
     }
-
 }
index db017c92506d2372a3c67a22c08e09c2b5818926..c9830e2fc151a79ce6e0bb4b0b2d9f580372cab8 100644 (file)
@@ -5,12 +5,10 @@
  * 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.eric;
 
 import com.google.common.base.Preconditions;
 import org.opendaylight.openflowjava.eric.api.EricExtensionCodecRegistrator;
-import org.opendaylight.openflowjava.eric.codec.match.EricMatchCodecs;
 import org.opendaylight.openflowjava.eric.codec.match.Icmpv6NDOptionsTypeCodec;
 import org.opendaylight.openflowjava.eric.codec.match.Icmpv6NDReservedCodec;
 
@@ -20,13 +18,13 @@ public class EricExtensionsRegistrator implements AutoCloseable {
     public EricExtensionsRegistrator(EricExtensionCodecRegistrator registrator) {
         this.registrator = Preconditions.checkNotNull(registrator);
         registrator.registerMatchEntrySerializer(Icmpv6NDReservedCodec.SERIALIZER_KEY,
-                EricMatchCodecs.ICMPV_6_ND_RESERVED_CODEC);
+                Icmpv6NDReservedCodec.INSTANCE);
         registrator.registerMatchEntrySerializer(Icmpv6NDOptionsTypeCodec.SERIALIZER_KEY,
-                EricMatchCodecs.ICMPV_6_ND_OPTIONS_TYPE_CODEC);
+                Icmpv6NDOptionsTypeCodec.INSTANCE);
         registrator.registerMatchEntryDeserializer(Icmpv6NDReservedCodec.DESERIALIZER_KEY,
-                EricMatchCodecs.ICMPV_6_ND_RESERVED_CODEC);
+                Icmpv6NDReservedCodec.INSTANCE);
         registrator.registerMatchEntryDeserializer(Icmpv6NDOptionsTypeCodec.DESERIALIZER_KEY,
-                EricMatchCodecs.ICMPV_6_ND_OPTIONS_TYPE_CODEC);
+                Icmpv6NDOptionsTypeCodec.INSTANCE);
     }
 
     @Override
@@ -36,5 +34,4 @@ public class EricExtensionsRegistrator implements AutoCloseable {
         registrator.unregisterMatchEntryDeserializer(Icmpv6NDReservedCodec.DESERIALIZER_KEY);
         registrator.unregisterMatchEntryDeserializer(Icmpv6NDOptionsTypeCodec.DESERIALIZER_KEY);
     }
-
 }
\ No newline at end of file
diff --git a/extension/openflowjava-extension-eric/src/main/java/org/opendaylight/openflowjava/eric/codec/match/EricMatchCodecs.java b/extension/openflowjava-extension-eric/src/main/java/org/opendaylight/openflowjava/eric/codec/match/EricMatchCodecs.java
deleted file mode 100644 (file)
index 4e24d04..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (c) 2019 Ericsson India Global Services Pvt Ltd. 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.eric.codec.match;
-
-/**
- * Defines Eric match codecs.
- */
-public interface EricMatchCodecs {
-
-    Icmpv6NDReservedCodec ICMPV_6_ND_RESERVED_CODEC = new Icmpv6NDReservedCodec();
-    Icmpv6NDOptionsTypeCodec ICMPV_6_ND_OPTIONS_TYPE_CODEC = new Icmpv6NDOptionsTypeCodec();
-
-}
\ No newline at end of file
index 1d24d6faa8fcc7143aea55382eb3b6061a4fa552..65289e8a75d9c778a2efa555a41e68b4e426e6ce 100644 (file)
@@ -30,6 +30,7 @@ public class Icmpv6NDOptionsTypeCodec extends AbstractMatchCodec {
     public static final MatchEntryDeserializerKey DESERIALIZER_KEY = new MatchEntryDeserializerKey(
             EncodeConstants.OF13_VERSION_ID, EricConstants.ERICOXM_OF_EXPERIMENTER_ID,
             EricConstants.ERICOXM_OF_ICMPV6_ND_OPTIONS_TYPE);
+    public static final Icmpv6NDOptionsTypeCodec INSTANCE = new Icmpv6NDOptionsTypeCodec();
 
     @Override
     public void serialize(MatchEntry input, ByteBuf outBuffer) {
index 0c6ab130627008fd4f9810ca8684edbc8a23e030..8ef6f31e464969b387f346a4ad5fb51abf61338d 100644 (file)
@@ -24,6 +24,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.eric.match.rev
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.eric.match.rev180730.oxm.container.match.entry.value.Icmpv6NdReservedCaseValueBuilder;
 
 public class Icmpv6NDReservedCodec extends AbstractMatchCodec {
+    public static final Icmpv6NDReservedCodec INSTANCE = new Icmpv6NDReservedCodec();
 
     private static final int VALUE_LENGTH = 4;
     public static final MatchEntrySerializerKey<?, ?> SERIALIZER_KEY = new MatchEntrySerializerKey<>(