Fix checkstyle violations in openflow-protocol-api 76/67376/1
authorTom Pantelis <tompantelis@gmail.com>
Sat, 20 Jan 2018 18:03:32 +0000 (13:03 -0500)
committerTom Pantelis <tompantelis@gmail.com>
Sat, 20 Jan 2018 18:03:32 +0000 (13:03 -0500)
Change-Id: Ie6aa924aeb857035e8389a50a70d6c9149d4e4ee
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
70 files changed:
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/ConnectionAdapter.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/ConnectionConfiguration.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/ConnectionReadyListener.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/ListeningStatusProvider.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/OutboundQueue.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/StatisticsConfiguration.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/SwitchConnectionHandler.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/ThreadConfiguration.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/TlsConfiguration.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/TlsConfigurationImpl.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/AlienMessageListener.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/DeserializerExtensionProvider.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/DeserializerRegistry.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/DeserializerRegistryInjector.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageCodeKey.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageTypeKey.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/HeaderDeserializer.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/HeaderSerializer.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/OFDeserializer.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/OFGeneralDeserializer.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/OFGeneralSerializer.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/OFSerializer.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/SerializerExtensionProvider.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/SerializerRegistry.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/SerializerRegistryInjector.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ActionDeserializerKey.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ActionSerializerKey.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterActionDeserializerKey.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterActionSerializerKey.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterDeserializerKey.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterIdDeserializerKey.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterIdMeterSubTypeSerializerKey.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterIdSerializerKey.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterIdTypeDeserializerKey.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterIdTypeSerializerKey.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterInstructionDeserializerKey.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterInstructionSerializerKey.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterSerializerKey.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionDeserializerKey.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionSerializerKey.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/MatchEntryDeserializerKey.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/MatchEntrySerializerKey.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/MessageCodeKey.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/MessageTypeKey.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/TypeToClassKey.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/util/BinContent.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/util/EncodeConstants.java
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/util/OxmMatchConstants.java
openflowjava/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/connection/TlsConfigurationImplTest.java
openflowjava/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageCodeKeyTest.java
openflowjava/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageTypeKeyTest.java
openflowjava/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/extensibility/MessageCodeKeyTest.java
openflowjava/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/extensibility/MessageTypeKeyTest.java
openflowjava/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/ActionDeserializerKeyTest.java
openflowjava/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/ActionSerializerKeyTest.java
openflowjava/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionDeserializerKeyTest.java
openflowjava/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionSerializerKeyTest.java
openflowjava/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/KeysTest.java
openflowjava/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/MatchEntryDeserializerKeyTest.java
openflowjava/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/MatchEntrySerializerKeyTest.java
openflowjava/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/TypeToClassKeyTest.java
openflowjava/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterActionDeserializerKeyTest.java
openflowjava/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterActionSerializerKeyTest.java
openflowjava/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterIdDeserializerKeyTest.java
openflowjava/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterIdSerializerKeyTest.java
openflowjava/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterIdTypeDeserializerKeyTest.java
openflowjava/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterIdTypeSerializerKeyTest.java
openflowjava/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterInstructionDeserializerKeyTest.java
openflowjava/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterInstructionSerializerKeyTest.java
openflowjava/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/util/BinContentTest.java

index a61ea51336fcb42df898f667df98211a9b65f47d..af0265d832af337ecefbd8f28bb9f5cb2000c418 100644 (file)
@@ -16,74 +16,89 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.system.rev130927.SystemNotificationsListener;
 
 /**
+ * Manages a switch connection.
+ *
  * @author mirehak
  * @author michal.polkorab
  */
 public interface ConnectionAdapter extends OpenflowProtocolService {
 
     /**
-     * disconnect corresponding switch
+     * Disconnect corresponding switch.
+     *
      * @return future set to true, when disconnect completed
      */
     Future<Boolean> disconnect();
 
     /**
+     * Determines if the connection to the switch is alive.
+     *
      * @return true, if connection to switch is alive
      */
     boolean isAlive();
 
     /**
+     * Returns the address of the connected switch.
+     *
      * @return address of the remote end - address of a switch if connected
      */
     InetSocketAddress getRemoteAddress();
 
     /**
+     * Sets the protocol message listener.
+     *
      * @param messageListener here will be pushed all messages from switch
      */
     void setMessageListener(OpenflowProtocolListener messageListener);
 
     /**
+     * Sets the system message listener.
+     *
      * @param systemListener here will be pushed all system messages from library
      */
     void setSystemListener(SystemNotificationsListener systemListener);
 
     /**
-     * Set handler for alien messages received from device
+     * Set handler for alien messages received from device.
+     *
      * @param alienMessageListener here will be pushed all alien messages from switch
      */
     void setAlienMessageListener(AlienMessageListener alienMessageListener);
 
     /**
-     * Throws exception if any of required listeners is missing
+     * Throws exception if any of required listeners is missing.
      */
     void checkListeners();
 
     /**
-     * notify listener about connection ready-to-use event
+     * Notify listener about connection ready-to-use event.
      */
     void fireConnectionReadyNotification();
 
     /**
-     * set listener for connection became ready-to-use event
+     * Set listener for connection became ready-to-use event.
+     *
      * @param connectionReadyListener listens to connection ready event
      */
     void setConnectionReadyListener(ConnectionReadyListener connectionReadyListener);
 
     /**
-     * sets option for automatic channel reading;
-     * if set to false, incoming messages won't be read
+     * Sets option for automatic channel reading - if set to false, incoming messages won't be read.
      *
      * @param autoRead target value to be switched to
      */
     void setAutoRead(boolean autoRead);
 
     /**
-     * @return true, if channel is configured to autoread
+     * Determines if the channel is configured to auto-read.
+     *
+     * @return true, if channel is configured to auto-read
      */
     boolean isAutoRead();
 
     /**
-     * Registers a new bypass outbound queue
+     * Registers a new bypass outbound queue.
+     *
      * @param <T> handler type
      * @param handler queue handler
      * @param maxQueueDepth max amount of not confirmed messaged in queue (i.e. edge for barrier message)
index 578e97b552479f78212bff0fe6935fb7f2e3f063..ac9d913d34c0a08b02f4bdb0625a6dc5a343cd7d 100644 (file)
@@ -10,31 +10,43 @@ package org.opendaylight.openflowjava.protocol.api.connection;
 import java.net.InetAddress;
 
 /**
+ * Configuration for a switch connection.
+ *
  * @author mirehak
  */
 public interface ConnectionConfiguration {
 
     /**
+     * Returns address to bind.
+     *
      * @return address to bind, if null, all available interfaces will be used
      */
     InetAddress getAddress();
 
     /**
+     * Returns the port to bind.
+     *
      * @return port to bind
      */
     int getPort();
 
     /**
+     * Returns the transport protocol to use.
+     *
      * @return transport protocol to use
      */
     Object getTransferProtocol();
 
     /**
+     * Returns the TLS configuration.
+     *
      * @return TLS configuration object
      */
     TlsConfiguration getTlsConfiguration();
 
     /**
+     * Returns the swicth idle timeout.
+     *
      * @return silence time (in milliseconds) - after this time
      *         {@link org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.system.rev130927.SwitchIdleEvent}
      *         message is sent upstream
@@ -42,16 +54,22 @@ public interface ConnectionConfiguration {
     long getSwitchIdleTimeout();
 
     /**
+     * Returns the SSL context.
+     *
      * @return seed for {@link javax.net.ssl.SSLEngine}
      */
     Object getSslContext();
 
     /**
+     * Returns the thread configuration.
+     *
      * @return thread numbers for TcpHandler's eventloopGroups
      */
     ThreadConfiguration getThreadConfiguration();
 
     /**
+     * Determines if a barrier shoild be used.
+     *
      * @return boolean value for usability of Barrier
      */
     boolean useBarrier();
index 0c7e026df3582f38cc5703316feec4e80a70d3e0..3d483345b7496c09d95c7bfff289f6b998d43cd8 100644 (file)
@@ -9,13 +9,14 @@
 package org.opendaylight.openflowjava.protocol.api.connection;
 
 /**
- * @author mirehak
+ * Listener that is notified when a switch connection is ready.
  *
+ * @author mirehak
  */
 public interface ConnectionReadyListener {
 
     /**
-     * fired when connection becomes ready-to-use
+     * Fired when connection becomes ready-to-use.
      */
     void onConnectionReady();
 }
index f54b7c2c0a5d2f2503269b88296053d3a6264931..57422efb0e9fb86d3c766896ec0a9a5c8bbba48a 100644 (file)
@@ -11,12 +11,15 @@ package org.opendaylight.openflowjava.protocol.api.connection;
 import java.util.concurrent.Future;
 
 /**
- * for testing purposed
+ * For testing purposes.
+ *
  * @author mirehak
  */
 public interface ListeningStatusProvider {
 
     /**
+     * Determines if the plugin has successfully started.
+     *
      * @return future holding startup result of all library instances under plugin's control
      */
     Future<Boolean> isOnline();
index 3b9e7752b9a80e5032055b5c3728709b437f3a13..0ce24cf9023dcb94cd4478bc486d45e8e930b481 100644 (file)
@@ -31,9 +31,11 @@ public interface OutboundQueue {
      * with a response, the object reported will be non-null. If the request's completion
      * is implied by a barrier, the object reported will be null.
      *
+     * <p>
      * If this request fails on the remote device, {@link FutureCallback#onFailure(Throwable)}
      * will be called with an instance of {@link DeviceRequestFailedException}.
      *
+     * <p>
      * If the request fails due to local reasons, {@link FutureCallback#onFailure(Throwable)}
      * will be called with an instance of {@link OutboundQueueException}. In particular, if
      * this request failed because the device disconnected, {@link OutboundQueueException#DEVICE_DISCONNECTED}
@@ -59,9 +61,11 @@ public interface OutboundQueue {
      * with a response, the object reported will be non-null. If the request's completion
      * is implied by a barrier, the object reported will be null.
      *
+     * <p>
      * If this request fails on the remote device, {@link FutureCallback#onFailure(Throwable)}
      * will be called with an instance of {@link DeviceRequestFailedException}.
      *
+     * <p>
      * If the request fails due to local reasons, {@link FutureCallback#onFailure(Throwable)}
      * will be called with an instance of {@link OutboundQueueException}. In particular, if
      * this request failed because the device disconnected, {@link OutboundQueueException#DEVICE_DISCONNECTED}
index daf870690b0f174e005ef8449ff140c977645734..e3d1246f7709a21d4049720350fddbfaef4a2dfc 100644 (file)
@@ -9,19 +9,23 @@
 package org.opendaylight.openflowjava.protocol.api.connection;
 
 /**
- * Used for StatisticsCounter configuration
+ * Used for StatisticsCounter configuration.
  *
  * @author madamjak
  */
 public interface StatisticsConfiguration {
 
     /**
+     * Determines if statistics are enabled.
+     *
      * @return true if statistics are / will be collected, false otherwise
      */
     boolean getStatisticsCollect();
 
     /**
+     * Returns the delay between two statistics logs.
+     *
      * @return delay between two statistics logs (in milliseconds)
      */
     int getLogReportDelay();
-}
\ No newline at end of file
+}
index 8b4fddf6ba30ba30bfb1b33398c8523f5ea34d5c..554a5c2a91544898a5ad55cc7bfe15ca7a39482b 100644 (file)
@@ -12,6 +12,8 @@ package org.opendaylight.openflowjava.protocol.api.connection;
 import java.net.InetAddress;
 
 /**
+ * Handler for a swictch connection.
+ *
  * @author mirehak
  * @author michal.polkorab
  *
@@ -19,11 +21,15 @@ import java.net.InetAddress;
 public interface SwitchConnectionHandler {
 
     /**
+     * Invoked when a switch connects.
+     *
      * @param connection to switch proving message sending/receiving, connection management
      */
     void onSwitchConnected(ConnectionAdapter connection);
 
     /**
+     * Invoked to determine if a switch connection should be accepted.
+     *
      * @param switchAddress address of incoming connection (address + port)
      * @return true, if connection from switch having given address shell be accepted; false otherwise
      */
index e3d1fb66c40c1cdaf36404b7140f79443bb5696f..b0f311c750c2200daddb96a3dfb04c88a288e1cb 100644 (file)
@@ -9,18 +9,23 @@
 package org.opendaylight.openflowjava.protocol.api.connection;
 
 /**
- * @author michal.polkorab
+ * Threading configuration.
  *
+ * @author michal.polkorab
  */
 public interface ThreadConfiguration {
 
     /**
-     * @return desired number of workerThreads processing the Openflow I/O
+     * Returns the desired number of Openflow I/O worker threads.
+     *
+     * @return desired number of worker threads processing the Openflow I/O
      */
     int getWorkerThreadCount();
 
     /**
-     * @return desired number of bossThreads registering incomming Openflow connections
+     * Returns the desired number of incoming Openflow connection threads.
+     *
+     * @return desired number of bossThreads registering incoming Openflow connections
      */
     int getBossThreadCount();
 }
index f5a71a8c2c4113c1c8c967dba0fe5d29a069a8f0..f744f6a1016bf54beea9c4a7c26a7f1ed29270ef 100644 (file)
@@ -9,63 +9,83 @@
 package org.opendaylight.openflowjava.protocol.api.connection;
 
 import java.util.List;
-
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.KeystoreType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.PathType;
 
 
 /**
- * @author michal.polkorab
+ * Tls configuration.
  *
+ * @author michal.polkorab
  */
 public interface TlsConfiguration {
 
     /**
-     * @return keystore location
+     * Returns the key store location.
+     *
+     * @return key store location
      */
     String getTlsKeystore();
 
     /**
-     * @return keystore type
+     * Returns the key store type.
+     *
+     * @return key store type
      */
     KeystoreType getTlsKeystoreType();
 
     /**
-     * @return truststore location
+     * Returns the trust store location.
+     *
+     * @return trust store location
      */
     String getTlsTruststore();
 
     /**
-     * @return truststore type
+     * Returns the trust store type.
+     *
+     * @return trust store type
      */
     KeystoreType getTlsTruststoreType();
 
     /**
-     * @return keystore path type (CLASSPATH or PATH)
+     * Returns the key store path type.
+     *
+     * @return key store path type (CLASSPATH or PATH)
      */
     PathType getTlsKeystorePathType();
 
     /**
-     * @return truststore path type (CLASSPATH or PATH)
+     * Returns the trust store path type.
+     *
+     * @return trust store path type (CLASSPATH or PATH)
      */
     PathType getTlsTruststorePathType();
 
     /**
-     * @return password protecting specified keystore
+     * Returns the password protecting the key store.
+     *
+     * @return password protecting the specified key store
      */
     String getKeystorePassword();
 
     /**
+     * Returns the password protecting the certificate.
+     *
      * @return password protecting certificate
      */
     String getCertificatePassword();
 
     /**
-     * @return password protecting specified truststore
+     * Returns the password protecting the trust store.
+     *
+     * @return password protecting specified trust store
      */
     String getTruststorePassword();
 
     /**
+     * Returns the list of cipher suites for TLS connection.
+     *
      * @return list of cipher suites for TLS connection
      */
     List<String> getCipherSuites();
index 2a290140ba5abe2c6b64d56622b88eaf0e31ef23..eeb3d52e0c60976404c1ae42c65983e48afc44f1 100644 (file)
@@ -9,26 +9,27 @@
 package org.opendaylight.openflowjava.protocol.api.connection;
 
 import java.util.List;
-
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.KeystoreType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.PathType;
 
 /**
- * Class is used only for testing purposes - passwords are hardcoded
+ * Class is used only for testing purposes - passwords are hard-coded.
+ *
  * @author michal.polkorab
  */
 public class TlsConfigurationImpl implements TlsConfiguration {
 
-    private KeystoreType trustStoreType;
-    private String trustStore;
-    private KeystoreType keyStoreType;
-    private String keyStore;
-    private PathType keystorePathType;
-    private PathType truststorePathType;
-    private List<String> cipherSuites;
+    private final KeystoreType trustStoreType;
+    private final String trustStore;
+    private final KeystoreType keyStoreType;
+    private final String keyStore;
+    private final PathType keystorePathType;
+    private final PathType truststorePathType;
+    private final List<String> cipherSuites;
 
     /**
-     * Default constructor
+     * Default constructor.
+     *
      * @param trustStoreType JKS or PKCS12
      * @param trustStore path to trustStore file
      * @param trustStorePathType truststore path type (classpath or path)
index 5b36d30543a790385908cbe2b1552256190cada2..286ef57870a5321e4a7dd343bda96462d4c36660 100644 (file)
@@ -12,9 +12,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 public interface AlienMessageListener {
 
     /**
-     * Handler for alien but successfully deserialized messages for device
+     * Handler for alien but successfully deserialized messages for device.
+     *
      * @param message alien message
      * @return true if alien message was successfully processed
      */
     boolean onAlienMessage(OfHeader message);
-}
\ No newline at end of file
+}
index 5a0658eb1b122c9b244c0e5de1c34a97c6463632..6b719cbc99c9ea49c0b8f62045937c1d0ef913eb 100644 (file)
@@ -27,6 +27,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
  * vendor / experimenter subtype, vendor has to switch / choose between
  * these subtypes.<br>
  *
+ * <p>
  * This has to be done in this way because of experimenter headers, which
  * provide only vendor / experimenter ID. Subtype position may be different
  * for different vendors (or not present at all) - that's why vendor has to
@@ -39,6 +40,7 @@ public interface DeserializerExtensionProvider {
      * Registers deserializer.
      * Throws IllegalStateException when there is
      * a deserializer already registered under given key.
+     *
      * <p>
      * If the deserializer implements {@link DeserializerRegistryInjector} interface,
      * the deserializer is injected with DeserializerRegistry instance.
@@ -50,15 +52,17 @@ public interface DeserializerExtensionProvider {
                               OFGeneralDeserializer deserializer);
 
     /**
-     * Unregisters custom deserializer
+     * Unregisters custom deserializer.
+     *
      * @param key used for deserializer lookup
      * @return true if deserializer was removed,
-     *  false if no deserializer was found under specified key
+     *     false if no deserializer was found under specified key
      */
     boolean unregisterDeserializer(ExperimenterDeserializerKey key);
 
     /**
-     * Registers action deserializer
+     * Registers action deserializer.
+     *
      * @param key used for deserializer lookup
      * @param deserializer deserializer instance
      */
@@ -66,7 +70,8 @@ public interface DeserializerExtensionProvider {
             OFGeneralDeserializer deserializer);
 
     /**
-     * Registers instruction deserializer
+     * Registers instruction deserializer.
+     *
      * @param key used for deserializer lookup
      * @param deserializer deserializer instance
      */
@@ -74,7 +79,8 @@ public interface DeserializerExtensionProvider {
             OFGeneralDeserializer deserializer);
 
     /**
-     * Registers match entry deserializer
+     * Registers match entry deserializer.
+     *
      * @param key used for deserializer lookup
      * @param deserializer deserializer instance
      */
@@ -82,7 +88,8 @@ public interface DeserializerExtensionProvider {
             OFGeneralDeserializer deserializer);
 
     /**
-     * Registers error message deserializer
+     * Registers error message deserializer.
+     *
      * @param key used for deserializer lookup
      * @param deserializer deserializer instance
      */
@@ -90,7 +97,8 @@ public interface DeserializerExtensionProvider {
             OFDeserializer<ErrorMessage> deserializer);
 
     /**
-     * Registers experimenter (vendor) message deserializer
+     * Registers experimenter (vendor) message deserializer.
+     *
      * @param key used for deserializer lookup
      * @param deserializer deserializer instance
      */
@@ -98,7 +106,8 @@ public interface DeserializerExtensionProvider {
                                                  OFDeserializer<? extends ExperimenterDataOfChoice> deserializer);
 
     /**
-     * Registers multipart-reply (stats) message deserializer
+     * Registers multipart-reply (stats) message deserializer.
+     *
      * @param key used for deserializer lookup
      * @param deserializer deserializer instance
      */
@@ -106,7 +115,8 @@ public interface DeserializerExtensionProvider {
                                                    OFDeserializer<? extends ExperimenterDataOfChoice> deserializer);
 
     /**
-     * Registers multipart-reply table-features message deserializer
+     * Registers multipart-reply table-features message deserializer.
+     *
      * @param key used for deserializer lookup
      * @param deserializer deserializer instance
      */
@@ -114,7 +124,8 @@ public interface DeserializerExtensionProvider {
             OFGeneralDeserializer deserializer);
 
     /**
-     * Registers meter band deserializer (used in multipart-reply meter-config)
+     * Registers meter band deserializer (used in multipart-reply meter-config).
+     *
      * @param key used for deserializer lookup
      * @param deserializer deserializer instance
      */
@@ -122,7 +133,8 @@ public interface DeserializerExtensionProvider {
             OFDeserializer<MeterBandExperimenterCase> deserializer);
 
     /**
-     * Registers queue property (QUEUE_GET_CONFIG_REPLY message) deserializer
+     * Registers queue property (QUEUE_GET_CONFIG_REPLY message) deserializer.
+     *
      * @param key used for deserializer lookup
      * @param deserializer deserializer instance
      */
@@ -130,14 +142,16 @@ public interface DeserializerExtensionProvider {
             OFDeserializer<QueueProperty> deserializer);
 
     /**
-     * Registers type to class mapping used to assign return type when deserializing message
+     * Registers type to class mapping used to assign return type when deserializing message.
+     *
      * @param key type to class key
      * @param clazz return class
      */
     void registerDeserializerMapping(TypeToClassKey key, Class<?> clazz);
 
     /**
-     * Unregisters type to class mapping used to assign return type when deserializing message
+     * Unregisters type to class mapping used to assign return type when deserializing message.
+     *
      * @param key type to class key
      * @return true if mapping was successfully removed
      */
index 27660398b42b0225ddd128601be5800f6b5c2b5b..15253f5bee99570c1cc2919906f7378f05b3de21 100644 (file)
@@ -9,19 +9,21 @@ package org.opendaylight.openflowjava.protocol.api.extensibility;
 
 import org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey;
 
-
 /**
- * @author michal.polkorab
+ * Registry for deserializers.
  *
+ * @author michal.polkorab
  */
 public interface DeserializerRegistry {
 
     /**
-     * Initializes deserializers
+     * Initializes deserializers.
      */
     void init();
 
     /**
+     * Gets the deserializer for the given key.
+     *
      * @param <T> type of particular deserializer
      * @param key used for deserializer lookup
      * @return deserializer found
@@ -30,10 +32,11 @@ public interface DeserializerRegistry {
             T getDeserializer(MessageCodeKey key);
 
     /**
-     * Registers deserializer.
+     * Registers deserializer.
      * Throws IllegalStateException when there is
      * a deserializer already registered under given key.
      *
+     * <p>
      * If the deserializer implements {@link DeserializerRegistryInjector} interface,
      * the deserializer is injected with DeserializerRegistry instance.
      *
@@ -44,10 +47,11 @@ public interface DeserializerRegistry {
             OFGeneralDeserializer deserializer);
 
     /**
-     * Unregisters deserializer
+     * Unregisters a deserializer.
+     *
      * @param key used for deserializer lookup
      * @return true if deserializer was removed,
-     *  false if no deserializer was found under specified key
+     *     false if no deserializer was found under specified key
      */
     boolean unregisterDeserializer(MessageCodeKey key);
 }
index 98e836334fd7427550d706d69ec6074e7c9f1d86..088cbf9d0405a2986be72eca095c342813b24757 100644 (file)
@@ -8,13 +8,15 @@
 package org.opendaylight.openflowjava.protocol.api.extensibility;
 
 /**
- * Injects registry
+ * Injects registries.
+ *
  * @author michal.polkorab
  */
 public interface DeserializerRegistryInjector {
 
     /**
-     * Injects deserializer registry into deserializer
+     * Injects deserializer registry into deserializer.
+     *
      * @param deserializerRegistry registry of deserializers
      */
     void injectDeserializerRegistry(DeserializerRegistry deserializerRegistry);
index b8a7ec0df00a729d7bbedebb1c6b225771c7afd7..e8b8e9541f5d52bd26a1042f5b3e82b0fd33abe0 100644 (file)
@@ -10,15 +10,17 @@ package org.opendaylight.openflowjava.protocol.api.extensibility;
 import org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey;
 
 /**
- * @author michal.polkorab
+ * Enhanced MessageCodeKey.
  *
+ * @author michal.polkorab
  */
 public class EnhancedMessageCodeKey extends MessageCodeKey {
 
-    private int msgType2;
+    private final int msgType2;
 
     /**
-     * Constructor
+     * Constructor.
+     *
      * @param version wire protocol version
      * @param value used as distinguisher
      * @param value2 used as detailed distinguisher
@@ -59,4 +61,4 @@ public class EnhancedMessageCodeKey extends MessageCodeKey {
     public String toString() {
         return super.toString() + " msgType2: " + msgType2;
     }
-}
\ No newline at end of file
+}
index 3a9fffc260fbf616e1269ba91c2c9f907e530930..7747821cc2a9737a72ffd5c028bb681d441d8aba 100644 (file)
@@ -11,7 +11,8 @@ import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
 
 
 /**
- * More specific key for {@link SerializerRegistry}
+ * More specific key for {@link SerializerRegistry}.
+ *
  * @author michal.polkorab
  * @param <E> main type
  * @param <F> specific type
@@ -21,6 +22,8 @@ public class EnhancedMessageTypeKey<E, F> extends MessageTypeKey<E> {
     private final Class<F> msgType2;
 
     /**
+     * Constructor.
+     *
      * @param msgVersion protocol version
      * @param msgType main type
      * @param msgType2 subtype
@@ -34,7 +37,7 @@ public class EnhancedMessageTypeKey<E, F> extends MessageTypeKey<E> {
     public int hashCode() {
         final int prime = 31;
         int result = super.hashCode();
-        result = prime * result + ((msgType2 == null) ? 0 : msgType2.hashCode());
+        result = prime * result + (msgType2 == null ? 0 : msgType2.hashCode());
         return result;
     }
 
index c80df7b964867b5d58246337886f007be4b455f0..05f1b60d25d59fee1bd09a7181ef74761a48d55d 100644 (file)
@@ -11,13 +11,15 @@ import io.netty.buffer.ByteBuf;
 import org.opendaylight.yangtools.yang.binding.DataContainer;
 
 /**
+ * Deserializes headers.
+ *
  * @author michal.polkorab
  * @param <E> output message type
  */
 public interface HeaderDeserializer<E extends DataContainer> extends OFGeneralDeserializer {
 
     /**
-     * Deserializes byte message headers
+     * Deserializes a byte message headers.
      *
      * @param rawMessage message as bytes in ByteBuf
      * @return POJO/DTO
index 427d84ce29b15291d46104d74b6d7d6bcd40841b..3a0e61e8bed8a2cac32921472d958d859bb97554 100644 (file)
@@ -11,14 +11,16 @@ import io.netty.buffer.ByteBuf;
 import org.opendaylight.yangtools.yang.binding.DataContainer;
 
 /**
- * Does only-header serialization (such as oxm_ids, action_ids, instruction_ids)
+ * Does only-header serialization (such as oxm_ids, action_ids, instruction_ids).
+ *
  * @author michal.polkorab
  * @param <T> input message type
  */
 public interface HeaderSerializer<T extends DataContainer> extends OFGeneralSerializer {
 
     /**
-     * Serializes object headers (e.g. for Multipart message - Table Features)
+     * Serializes object headers (e.g. for Multipart message - Table Features).
+     *
      * @param input object whose headers should be serialized
      * @param outBuffer output buffer
      */
index 06c54f9dc47ae622cf447f4d4e3ea0ca2898c675..e98189240ad016f01f484677ae38942c4e9a301b 100644 (file)
@@ -12,7 +12,8 @@ import io.netty.buffer.ByteBuf;
 import org.opendaylight.yangtools.yang.binding.DataContainer;
 
 /**
- * Uniform interface for deserializing factories
+ * Uniform interface for deserializing factories.
+ *
  * @author michal.polkorab
  * @author timotej.kubas
  * @param <E> message code type
index c4132cc6dd564481a9a5aaeb82553e7efe1f74d5..69c66e3944442feb91ba2f3f04d04c1f5d671f31 100644 (file)
@@ -7,8 +7,9 @@
  */
 package org.opendaylight.openflowjava.protocol.api.extensibility;
 
-
 /**
+ * Unifying super interface for a general deserializer.
+ *
  * @author michal.polkorab
  */
 public interface OFGeneralDeserializer {
index 6dd5d3f07ba41027dfdcc724cfba5e1c8446ec12..8d748f76d905ec7de5b17262fbbd35caf63084d5 100644 (file)
@@ -8,7 +8,8 @@
 package org.opendaylight.openflowjava.protocol.api.extensibility;
 
 /**
- * Unifying superinterface
+ * Unifying super interface for a general derializer.
+ *
  * @author michal.polkorab
  * */
 public interface OFGeneralSerializer {
index ec63be53d2784bee65d9686fe24c295167ced7fb..003c06827055bc0dfd9716d53918bf9c341d56ef 100644 (file)
@@ -12,7 +12,8 @@ import io.netty.buffer.ByteBuf;
 import org.opendaylight.yangtools.yang.binding.DataContainer;
 
 /**
- * Uniform interface for serializers
+ * Uniform interface for serializers.
+ *
  * @author michal.polkorab
  * @author timotej.kubas
  * @param <T> message type
index 366cd3ab9381f6eaa42efa6726beafea4065e226..8ec475dd3fd52bbd51a27eb0149bd0aa9e852832 100755 (executable)
@@ -29,6 +29,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
  * vendor / experimenter subtype, vendor has to switch / choose between
  * these subtypes.<br>
  *
+ * <p>
  * This has to be done in this way because of unknown augmentations
  * - that's why vendor has to handle it in his own implementations.
  * @author michal.polkorab
@@ -36,7 +37,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 public interface SerializerExtensionProvider {
 
     /**
-     * Registers serializer
+     * Registers a custom serializer.
+     *
      * Throws IllegalStateException when there is
      * a serializer already registered under given key.
      *
@@ -51,15 +53,16 @@ public interface SerializerExtensionProvider {
             OFGeneralSerializer serializer);
 
     /**
-     * Unregisters custom serializer
+     * Unregisters a custom serializer.
+     *
      * @param key used for serializer lookup
-     * @return true if serializer was removed,
-     *  false if no serializer was found under specified key
+     * @return true if serializer was removed, false if no serializer was found under specified key
      */
     boolean unregisterSerializer(ExperimenterSerializerKey key);
 
     /**
-     * Registers action serializer
+     * Registers an action serializer.
+     *
      * @param key used for serializer lookup
      * @param serializer serializer implementation
      */
@@ -67,7 +70,8 @@ public interface SerializerExtensionProvider {
             OFGeneralSerializer serializer);
 
     /**
-     * Registers instruction serializer
+     * Registers an instruction serializer.
+     *
      * @param key used for serializer lookup
      * @param serializer serializer implementation
      */
@@ -75,7 +79,8 @@ public interface SerializerExtensionProvider {
             OFGeneralSerializer serializer);
 
     /**
-     * Registers match entry serializer
+     * Registers a match entry serializer.
+     *
      * @param <C> oxm type
      * @param <F> match field type
      * @param key used for serializer lookup
@@ -85,7 +90,8 @@ public interface SerializerExtensionProvider {
             MatchEntrySerializerKey<C, F> key,OFGeneralSerializer serializer);
 
     /**
-     * Registers experimenter (vendor) message serializer
+     * Registers an experimenter (vendor) message serializer.
+     *
      * @param key used for serializer lookup
      * @param serializer serializer implementation
      */
@@ -93,7 +99,8 @@ public interface SerializerExtensionProvider {
                                                OFSerializer<? extends ExperimenterDataOfChoice> serializer);
 
     /**
-     * Registers multipart-request (stats-request) serializer
+     * Registers a multipart-request (stats-request) serializer.
+     *
      * @param key used for serializer lookup
      * @param serializer serializer implementation
      */
@@ -101,7 +108,8 @@ public interface SerializerExtensionProvider {
                                             OFSerializer<? extends ExperimenterDataOfChoice> serializer);
 
     /**
-     * Registers multipart-request table-features serializer
+     * Registers a multipart-request table-features serializer.
+     *
      * @param key used for serializer lookup
      * @param serializer serializer implementation
      */
@@ -109,18 +117,20 @@ public interface SerializerExtensionProvider {
             OFGeneralSerializer serializer);
 
     /**
-     * @deprecated Since we use ExperimenterIdMeterSubTypeSerializerKey as MeterBandSerializer's key, in order to avoid
-     * the occurrence of an error,we should discard this function
-     * Registers meter band serializer (used in meter-mod messages)
+     * Registers a meter band serializer (used in meter-mod messages).
+     *
      * @param key used for serializer lookup
      * @param serializer serializer implementation
+     * @deprecated Since we use ExperimenterIdMeterSubTypeSerializerKey as MeterBandSerializer's key, in order to avoid
+     *     the occurrence of an error,we should discard this function
      */
     @Deprecated
     void registerMeterBandSerializer(ExperimenterIdSerializerKey<MeterBandExperimenterCase> key,
             OFSerializer<MeterBandExperimenterCase> serializer);
 
     /**
-     * Registers meter band serializer (used in meter-mod messages)
+     * Registers a meter band serializer (used in meter-mod messages).
+     *
      * @param key used for serializer lookup
      * @param serializer serializer implementation
      */
index 1ddc48565e6daf2a5ea095161087d02d1d6e8e87..8da06ee968133c64039c6fd86e06145fab2fdd77 100644 (file)
@@ -10,7 +10,7 @@ package org.opendaylight.openflowjava.protocol.api.extensibility;
 import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
 
 /**
- * Stores and handles serializers<br>
+ * Stores and handles serializers<br>
  * K - {@link MessageTypeKey} parameter type,<br>
  * S - returned serializer type
  * @author michal.polkorab
@@ -18,11 +18,13 @@ import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
 public interface SerializerRegistry {
 
     /**
-     * Serializer registry provisioning
+     * Serializer registry provisioning.
      */
     void init();
 
     /**
+     * Gets the serializer for the given type.
+     *
      * @param <K> input key type
      * @param <S> type of resulting serializer
      * @param msgTypeKey lookup key
@@ -31,7 +33,8 @@ public interface SerializerRegistry {
     <K, S extends OFGeneralSerializer> S getSerializer(MessageTypeKey<K> msgTypeKey);
 
     /**
-     * Registers serializer
+     * Registers a serializer.
+     *
      * Throws IllegalStateException when there is
      * a serializer already registered under given key.
      *
@@ -46,7 +49,8 @@ public interface SerializerRegistry {
             OFGeneralSerializer serializer);
 
     /**
-     * Unregisters serializer
+     * Unregisters a serializer.
+     *
      * @param <K> serializer key type
      * @param key used for serializer lookup
      * @return true if serializer was removed,
index b074b15fc726920df4e19f5896d4f49506f050d4..02875229358a8f9f7bd9c26e11191de2418a6058 100644 (file)
@@ -8,13 +8,15 @@
 package org.opendaylight.openflowjava.protocol.api.extensibility;
 
 /**
- * Serializer registry injector
+ * Serializer registry injector.
+ *
  * @author michal.polkorab
  */
 public interface SerializerRegistryInjector {
 
     /**
-     * Injects serializer registry
+     * Injects serializer registry.
+     *
      * @param serializerRegistry registry instance
      */
     void injectSerializerRegistry(SerializerRegistry serializerRegistry);
index 208a122771aac664f2a342244b4b81886b2fe83e..3f7695a6818c0bf3a430a007ed98cd26bcc0eb7c 100644 (file)
@@ -11,13 +11,17 @@ package org.opendaylight.openflowjava.protocol.api.keys;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
 
 /**
- * @author michal.polkorab
+ * Key for an action deserializer.
  *
+ * @author michal.polkorab
  */
 public class ActionDeserializerKey extends MessageCodeKey {
 
-    private Long experimenterId;
+    private final Long experimenterId;
+
     /**
+     * Constructor.
+     *
      * @param version protocol wire version
      * @param type action type
      * @param experimenterId experimenter / vendor ID
@@ -32,7 +36,7 @@ public class ActionDeserializerKey extends MessageCodeKey {
     public int hashCode() {
         final int prime = 31;
         int result = super.hashCode();
-        result = prime * result + ((experimenterId == null) ? 0 : experimenterId.hashCode());
+        result = prime * result + (experimenterId == null ? 0 : experimenterId.hashCode());
         return result;
     }
 
@@ -62,4 +66,4 @@ public class ActionDeserializerKey extends MessageCodeKey {
     public String toString() {
         return super.toString() + " experimenterID: " + experimenterId;
     }
-}
\ No newline at end of file
+}
index 7d096f84e533c356d8894d03a11965a624980165..309189fd323fe488afbbc576a31842cd7d63bf92 100644 (file)
@@ -12,16 +12,20 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev1
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
 
 /**
+ * Key for an action serializer.
+ *
  * @author michal.polkorab
  * @param <T> action type
  */
 public class ActionSerializerKey<T extends ActionChoice> extends MessageTypeKey<Action>
         implements ExperimenterSerializerKey {
 
-    private Class<T> actionType;
-    private Long experimenterId;
+    private final Class<T> actionType;
+    private final Long experimenterId;
 
     /**
+     * Constructor.
+     *
      * @param msgVersion protocol wire version
      * @param actionType type of action
      * @param experimenterId experimenter / vendor ID
@@ -37,8 +41,8 @@ public class ActionSerializerKey<T extends ActionChoice> extends MessageTypeKey<
     public int hashCode() {
         final int prime = 31;
         int result = super.hashCode();
-        result = prime * result + ((actionType == null) ? 0 : actionType.hashCode());
-        result = prime * result + ((experimenterId == null) ? 0 : experimenterId.hashCode());
+        result = prime * result + (actionType == null ? 0 : actionType.hashCode());
+        result = prime * result + (experimenterId == null ? 0 : experimenterId.hashCode());
         return result;
     }
 
@@ -75,4 +79,4 @@ public class ActionSerializerKey<T extends ActionChoice> extends MessageTypeKey<
     public String toString() {
         return super.toString() + " action type: " + actionType.getName() + " experimenterID: " + experimenterId;
     }
-}
\ No newline at end of file
+}
index 40f21d76a6c870eaaa64febeba27900d535a3a67..ea8ddee55f0a2340ecfd40f08ebd4288d3087307 100644 (file)
@@ -11,18 +11,20 @@ package org.opendaylight.openflowjava.protocol.api.keys;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 
 /**
- * @author michal.polkorab
+ * Key for an experimenter action deserializer.
  *
+ * @author michal.polkorab
  */
 public final class ExperimenterActionDeserializerKey extends ActionDeserializerKey
         implements ExperimenterDeserializerKey {
 
     /**
+     * Constructor.
+     *
      * @param version protocol wire version
      * @param experimenterId experimenter / vendor ID
      */
     public ExperimenterActionDeserializerKey(short version, Long experimenterId) {
         super(version, EncodeConstants.EXPERIMENTER_VALUE, experimenterId);
     }
-
-}
\ No newline at end of file
+}
index b07c696ab5ccae482b2b5932893bcf162d1927d0..1b1dc424786a060581ae290cc7892dabe82ab680 100644 (file)
@@ -12,19 +12,24 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.ExperimenterActionSubType;
 
 /**
+ * Key for an experimenter action serializer.
+ *
  * @author michal.polkorab
  */
 public final class ExperimenterActionSerializerKey extends ActionSerializerKey<ExperimenterIdCase>
         implements ExperimenterSerializerKey {
 
-    private Class<? extends ExperimenterActionSubType> actionSubType;
+    private final Class<? extends ExperimenterActionSubType> actionSubType;
 
     /**
+     * Constructor.
+     *
      * @param msgVersion protocol wire version
      * @param experimenterId experimenter / vendor ID
      * @param actionSubType vendor defined subtype
      */
-    public ExperimenterActionSerializerKey(short msgVersion, Long experimenterId, Class<? extends ExperimenterActionSubType> actionSubType) {
+    public ExperimenterActionSerializerKey(short msgVersion, Long experimenterId,
+            Class<? extends ExperimenterActionSubType> actionSubType) {
         super(msgVersion, ExperimenterIdCase.class, experimenterId);
         this.actionSubType = actionSubType;
     }
@@ -33,7 +38,7 @@ public final class ExperimenterActionSerializerKey extends ActionSerializerKey<E
     public int hashCode() {
         final int prime = 31;
         int result = super.hashCode();
-        result = prime * result + ((actionSubType == null) ? 0 : actionSubType.hashCode());
+        result = prime * result + (actionSubType == null ? 0 : actionSubType.hashCode());
         return result;
     }
 
@@ -58,4 +63,4 @@ public final class ExperimenterActionSerializerKey extends ActionSerializerKey<E
         }
         return true;
     }
-}
\ No newline at end of file
+}
index 3169de76f43218ecc5fc56085877ec83075ba288..5d76a71fa5e4fc369ed402bc9f9ee435bb447ef1 100644 (file)
@@ -9,7 +9,8 @@
 package org.opendaylight.openflowjava.protocol.api.keys;
 
 /**
- * Marker interface - marks keys appropriate for experimenter deserializer registration
+ * Marker interface - marks keys appropriate for experimenter deserializer registration.
+ *
  * @author michal.polkorab
  */
 public interface ExperimenterDeserializerKey {
index ec2cf3e1c8322ed5402937894441b91170b75414..49c1c213be4781afeab5c533079202353581b22e 100644 (file)
@@ -12,13 +12,17 @@ import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yangtools.yang.binding.DataContainer;
 
 /**
+ * Key for an experimenter id deserializer.
+ *
  * @author michal.polkorab
  */
 public class ExperimenterIdDeserializerKey extends MessageCodeKey implements ExperimenterDeserializerKey {
 
-    private long experimenterId;
+    private final long experimenterId;
 
     /**
+     * Constructor.
+     *
      * @param <E> type of target experimenter object
      * @param version protocol wire version
      * @param experimenterId experimenter / vendor ID
@@ -31,7 +35,7 @@ public class ExperimenterIdDeserializerKey extends MessageCodeKey implements Exp
     }
 
     protected int hashCodeOfLong(long longValue) {
-        return (int) (longValue ^ (longValue >>> 32));
+        return (int) (longValue ^ longValue >>> 32);
     }
 
     @Override
@@ -64,4 +68,4 @@ public class ExperimenterIdDeserializerKey extends MessageCodeKey implements Exp
     public String toString() {
         return super.toString() + " experimenterID: " + experimenterId;
     }
-}
\ No newline at end of file
+}
index f568a0284f04abc6edc66d30e3a76e43cdb23f63..2fa5775fce0ebb375c01b3c7357b2a49efcf4558 100755 (executable)
@@ -11,20 +11,24 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev13
 import org.opendaylight.yangtools.yang.binding.DataContainer;
 
 /**
- * Created by hyy on 2016/9/8.
+ * Key for an experimenter id meter subtype serializer.
+ *
+ * @author hyy on 2016/9/8.
  */
 public class ExperimenterIdMeterSubTypeSerializerKey<T extends DataContainer> extends ExperimenterIdSerializerKey<T> {
 
-    private Class<? extends ExperimenterMeterBandSubType> meterSubType;
+    private final Class<? extends ExperimenterMeterBandSubType> meterSubType;
 
     /**
+     * Constructor.
+     *
      * @param msgVersion      protocol wire version
      * @param experimenterId  experimenter / vendor ID
      * @param objectClass     class of object to be serialized
      * @param meterSubType    vendor defined subtype
      */
     public ExperimenterIdMeterSubTypeSerializerKey(short msgVersion, long experimenterId,
-                                                   Class<T> objectClass, Class<? extends ExperimenterMeterBandSubType> meterSubType) {
+            Class<T> objectClass, Class<? extends ExperimenterMeterBandSubType> meterSubType) {
         super(msgVersion, experimenterId, objectClass);
         this.meterSubType = meterSubType;
     }
@@ -33,7 +37,7 @@ public class ExperimenterIdMeterSubTypeSerializerKey<T extends DataContainer> ex
     public int hashCode() {
         final int prime = 31;
         int result = super.hashCode();
-        result = prime * result + ((meterSubType == null) ? 0 : meterSubType.hashCode());
+        result = prime * result + (meterSubType == null ? 0 : meterSubType.hashCode());
         return result;
     }
 
index 8a900e346e02686eaf686908823ff6ef5bfcd507..bdbe9788201b0aa7dd3e85ffd90fbe9f048c9b45 100644 (file)
@@ -11,15 +11,19 @@ package org.opendaylight.openflowjava.protocol.api.keys;
 import org.opendaylight.yangtools.yang.binding.DataContainer;
 
 /**
+ * Key for an experimenter id serializer.
+ *
  * @author michal.polkorab
  * @param <T> class of object to be serialized
  */
 public class ExperimenterIdSerializerKey<T extends DataContainer> extends MessageTypeKey<T>
         implements ExperimenterSerializerKey {
 
-    private long experimenterId;
+    private final long experimenterId;
 
     /**
+     * Constructor.
+     *
      * @param msgVersion protocol wire version
      * @param experimenterId experimenter / vendor ID
      * @param objectClass class of object to be serialized
@@ -39,7 +43,7 @@ public class ExperimenterIdSerializerKey<T extends DataContainer> extends Messag
     }
 
     protected int hashCodeOfLong(long longValue) {
-        return (int) (longValue ^ (longValue >>> 32));
+        return (int) (longValue ^ longValue >>> 32);
     }
 
     @Override
@@ -64,4 +68,4 @@ public class ExperimenterIdSerializerKey<T extends DataContainer> extends Messag
     public String toString() {
         return super.toString() + " experimenterID: " + experimenterId;
     }
-}
\ No newline at end of file
+}
index c956feb06c1d355db06c191fc48adb1c381b47d5..23b2dfdd492141a287bcd04e01f18207a4adf913 100644 (file)
@@ -11,13 +11,17 @@ package org.opendaylight.openflowjava.protocol.api.keys;
 import org.opendaylight.yangtools.yang.binding.DataContainer;
 
 /**
+ * Key for an experimenter id type deserializer.
+ *
  * @author michal.polkorab
  */
 public class ExperimenterIdTypeDeserializerKey extends ExperimenterIdDeserializerKey {
 
-    private long type;
+    private final long type;
 
     /**
+     * Constructor.
+     *
      * @param <T>            type of target experimenter object
      * @param version        protocol wire version
      * @param experimenterId experimenter / vendor ID
@@ -57,4 +61,4 @@ public class ExperimenterIdTypeDeserializerKey extends ExperimenterIdDeserialize
     public String toString() {
         return super.toString() + "; type: " + type;
     }
-}
\ No newline at end of file
+}
index b8f6ac93267bdd83f2f004e133f8a951a33654de..cbd10c1a5a294e03cdfa2078d99fa8d9466bd346 100644 (file)
@@ -11,14 +11,18 @@ package org.opendaylight.openflowjava.protocol.api.keys;
 import org.opendaylight.yangtools.yang.binding.DataContainer;
 
 /**
+ * Key for an experimenter id type serializer.
+ *
  * @param <T> class of object to be serialized
  * @author michal.polkorab
  */
 public class ExperimenterIdTypeSerializerKey<T extends DataContainer> extends ExperimenterIdSerializerKey<T> {
 
-    private long type;
+    private final long type;
 
     /**
+     * Constructor.
+     *
      * @param msgVersion     protocol wire version
      * @param experimenterId experimenter / vendor ID
      * @param type           data type according to vendor implementation
@@ -57,4 +61,4 @@ public class ExperimenterIdTypeSerializerKey<T extends DataContainer> extends Ex
     public String toString() {
         return super.toString() + "; type: " + type;
     }
-}
\ No newline at end of file
+}
index eea3e4ef82eddf1c678a0fdf9c817ee395d78169..77fe9ca69c3a4753f50749f5a7dcea5474392064 100644 (file)
@@ -11,13 +11,16 @@ package org.opendaylight.openflowjava.protocol.api.keys;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 
 /**
- * @author michal.polkorab
+ * Key for an experimenter instruction deserializer.
  *
+ * @author michal.polkorab
  */
 public final class ExperimenterInstructionDeserializerKey extends InstructionDeserializerKey
         implements ExperimenterDeserializerKey {
 
     /**
+     * Constructor.
+     *
      * @param version protocol wire version
      * @param experimenterId experimenter (vendor) identifier
      */
@@ -25,4 +28,4 @@ public final class ExperimenterInstructionDeserializerKey extends InstructionDes
         super(version, EncodeConstants.EXPERIMENTER_VALUE, experimenterId);
     }
 
-}
\ No newline at end of file
+}
index 15ee03a04bc5994afe2de8b8a5f3b5573968bc5c..c4f1f16c4f16f691f0022a512cd0c7818ff521c9 100644 (file)
@@ -11,12 +11,16 @@ package org.opendaylight.openflowjava.protocol.api.keys;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.instruction.container.instruction.choice.ExperimenterIdCase;
 
 /**
+ * Key for an experimenter instruction serializer.
+ *
  * @author michal.polkorab
  */
 public final class ExperimenterInstructionSerializerKey extends InstructionSerializerKey<ExperimenterIdCase>
         implements ExperimenterSerializerKey {
 
     /**
+     * Constructor.
+     *
      * @param msgVersion protocol wire version
      * @param experimenterId experimenter / vendor ID
      */
@@ -24,4 +28,4 @@ public final class ExperimenterInstructionSerializerKey extends InstructionSeria
         super(msgVersion, ExperimenterIdCase.class, experimenterId);
     }
 
-}
\ No newline at end of file
+}
index d027155af7c332d177cfe3d4190d6d6ffd400f28..b4a78db23f53e56ff32bb6fc1b1efb71ae89ca61 100644 (file)
@@ -9,7 +9,8 @@
 package org.opendaylight.openflowjava.protocol.api.keys;
 
 /**
- * Marker interface - marks keys appropriate for experimenter serializer registration
+ * Marker interface - marks keys appropriate for experimenter serializer registration.
+ *
  * @author michal.polkorab
  */
 public interface ExperimenterSerializerKey {
index 8482f6ef2d6af928c8538319f908e828fe903de9..146bd919aa108efa30fe3e937bde359917f0088e 100644 (file)
@@ -11,19 +11,22 @@ package org.opendaylight.openflowjava.protocol.api.keys;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
 
 /**
- * @author michal.polkorab
+ * Key for an instruction deserializer.
  *
+ * @author michal.polkorab
  */
 public class InstructionDeserializerKey extends MessageCodeKey {
 
-    private Long experimenterId;
+    private final Long experimenterId;
+
     /**
+     * Constructor.
+     *
      * @param version protocol wire version
      * @param type instruction type
      * @param experimenterId experimenter (vendor) identifier
      */
-    public InstructionDeserializerKey(short version, int type,
-            Long experimenterId) {
+    public InstructionDeserializerKey(short version, int type, Long experimenterId) {
         super(version, type, Instruction.class);
         this.experimenterId = experimenterId;
     }
@@ -32,7 +35,7 @@ public class InstructionDeserializerKey extends MessageCodeKey {
     public int hashCode() {
         final int prime = 31;
         int result = super.hashCode();
-        result = prime * result + ((experimenterId == null) ? 0 : experimenterId.hashCode());
+        result = prime * result + (experimenterId == null ? 0 : experimenterId.hashCode());
         return result;
     }
 
@@ -62,4 +65,4 @@ public class InstructionDeserializerKey extends MessageCodeKey {
     public String toString() {
         return super.toString() + " experimenterID: " + experimenterId;
     }
-}
\ No newline at end of file
+}
index 213b22dbf19273ed3c0362bf8ffd588cc234ae60..ad2e1400ff02b19f7e75fbcb904e615f9184c384 100644 (file)
@@ -12,16 +12,20 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
 
 /**
+ * Key for an instruction serializer.
+ *
  * @author michal.polkorab
  * @param <T> instruction type
  */
 public class InstructionSerializerKey<T extends InstructionChoice>
         extends MessageTypeKey<Instruction> implements ExperimenterSerializerKey {
 
-    private Class<T> instructionType;
-    private Long experimenterId;
+    private final Class<T> instructionType;
+    private final Long experimenterId;
 
     /**
+     * Constructor.
+     *
      * @param msgVersion protocol wire version
      * @param instructionType type of instruction
      * @param experimenterId experimenter / vendor ID
@@ -37,8 +41,8 @@ public class InstructionSerializerKey<T extends InstructionChoice>
     public int hashCode() {
         final int prime = 31;
         int result = super.hashCode();
-        result = prime * result + ((experimenterId == null) ? 0 : experimenterId.hashCode());
-        result = prime * result + ((instructionType == null) ? 0 : instructionType.hashCode());
+        result = prime * result + (experimenterId == null ? 0 : experimenterId.hashCode());
+        result = prime * result + (instructionType == null ? 0 : instructionType.hashCode());
         return result;
     }
 
index 4f995959af2df5b33de0cf6a87c2fa8fbaf04115..ca7360af8b4df5af165dd11979e39245c81bbe57 100644 (file)
@@ -11,16 +11,19 @@ package org.opendaylight.openflowjava.protocol.api.keys;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 
 /**
- * @author michal.polkorab
+ * Key for a match entry deserializer.
  *
+ * @author michal.polkorab
  */
 public final class MatchEntryDeserializerKey extends MessageCodeKey
         implements ExperimenterDeserializerKey {
 
-    private int oxmField;
+    private final int oxmField;
     private Long experimenterId;
 
     /**
+     * Constructor.
+     *
      * @param version protocol wire version
      * @param oxmClass oxm_class (see specification)
      * @param oxmField oxm_field (see specification)
@@ -32,6 +35,8 @@ public final class MatchEntryDeserializerKey extends MessageCodeKey
     }
 
     /**
+     * Sets the experimenter id.
+     *
      * @param experimenterId experimenter / vendor ID
      */
     public void setExperimenterId(Long experimenterId) {
@@ -42,7 +47,7 @@ public final class MatchEntryDeserializerKey extends MessageCodeKey
     public int hashCode() {
         final int prime = 31;
         int result = super.hashCode();
-        result = prime * result + ((experimenterId == null) ? 0 : experimenterId.hashCode());
+        result = prime * result + (experimenterId == null ? 0 : experimenterId.hashCode());
         result = prime * result + oxmField;
         return result;
     }
@@ -76,4 +81,4 @@ public final class MatchEntryDeserializerKey extends MessageCodeKey
     public String toString() {
         return super.toString() + " oxm_field: " + oxmField + " experimenterID: " + experimenterId;
     }
-}
\ No newline at end of file
+}
index 75fcd3e60045b4b2c901155d6501e8b886985c40..c579dbecfffa46f07e24b4096ac5d6958abc43c2 100644 (file)
@@ -13,6 +13,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmC
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 
 /**
+ * Key for a match entry serializer.
+ *
  * @author michal.polkorab
  * @param <C> oxm_class (see specification)
  * @param <F> oxm_field (see specification)
@@ -20,11 +22,13 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
 public final class MatchEntrySerializerKey<C extends OxmClassBase, F extends MatchField>
         extends MessageTypeKey<MatchEntry> implements ExperimenterSerializerKey {
 
-    private Class<C> oxmClass;
-    private Class<F> oxmField;
+    private final Class<C> oxmClass;
+    private final Class<F> oxmField;
     private Long experimenterId;
 
     /**
+     * Constructor.
+     *
      * @param msgVersion protocol wire version
      * @param oxmClass oxm_class (see specification)
      * @param oxmField oxm_field (see specification)
@@ -37,6 +41,8 @@ public final class MatchEntrySerializerKey<C extends OxmClassBase, F extends Mat
     }
 
     /**
+     * Sets the experimenter id.
+     *
      * @param experimenterId experimenter / vendor ID
      */
     public void setExperimenterId(Long experimenterId) {
@@ -47,9 +53,9 @@ public final class MatchEntrySerializerKey<C extends OxmClassBase, F extends Mat
     public int hashCode() {
         final int prime = 31;
         int result = super.hashCode();
-        result = prime * result + ((experimenterId == null) ? 0 : experimenterId.hashCode());
-        result = prime * result + ((oxmClass == null) ? 0 : oxmClass.hashCode());
-        result = prime * result + ((oxmField == null) ? 0 : oxmField.hashCode());
+        result = prime * result + (experimenterId == null ? 0 : experimenterId.hashCode());
+        result = prime * result + (oxmClass == null ? 0 : oxmClass.hashCode());
+        result = prime * result + (oxmField == null ? 0 : oxmField.hashCode());
         return result;
     }
 
index 566b3623cd4c8570a252a9f7848bdfbf0f551db3..819e56f704e8bf07fb436a0098c86bf6b960a8de 100644 (file)
@@ -8,16 +8,19 @@
 package org.opendaylight.openflowjava.protocol.api.keys;
 
 /**
+ * Key for a message code.
+ *
  * @author michal.polkorab
  */
 public class MessageCodeKey {
 
-    private short msgVersion;
-    private int msgType;
-    private Class<?> clazz;
+    private final short msgVersion;
+    private final int msgType;
+    private final Class<?> clazz;
 
     /**
-     * Constructor
+     * Constructor.
+     *
      * @param version wire protocol version
      * @param value used as distinguisher (read from binary data / buffer)
      * @param clazz class of object that is going to be deserialized
@@ -40,7 +43,7 @@ public class MessageCodeKey {
     public int hashCode() {
         final int prime = 31;
         int result = 1;
-        result = prime * result + ((clazz == null) ? 0 : clazz.hashCode());
+        result = prime * result + (clazz == null ? 0 : clazz.hashCode());
         result = prime * result + msgType;
         result = prime * result + msgVersion;
         return result;
@@ -78,4 +81,4 @@ public class MessageCodeKey {
     public String toString() {
         return "msgVersion: " + msgVersion + " objectClass: " + clazz.getName() + " msgType: " + msgType;
     }
-}
\ No newline at end of file
+}
index 5a130cb1c10bc6d97a9d53fbee63559752d2b9ee..fb4096719cd21c7f36a628c7ac8ac0a001d31c95 100644 (file)
@@ -8,7 +8,8 @@
 package org.opendaylight.openflowjava.protocol.api.keys;
 
 /**
- * Class used as a key in {@link org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry}
+ * Class used as a key in {@link org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry}.
+ *
  * @author michal.polkorab
  * @author timotej.kubas
  * @param <E> message type (class)
@@ -19,6 +20,8 @@ public class MessageTypeKey<E> {
     private final short msgVersion;
 
     /**
+     * Constructor.
+     *
      * @param msgVersion protocol version
      * @param msgType type of message - class of serialized object
      */
@@ -36,7 +39,7 @@ public class MessageTypeKey<E> {
     public int hashCode() {
         final int prime = 31;
         int result = 1;
-        result = prime * result + ((msgType == null) ? 0 : msgType.hashCode());
+        result = prime * result + (msgType == null ? 0 : msgType.hashCode());
         result = prime * result + msgVersion;
         return result;
     }
index 71eed0948c76441939408f077f730568fe920ead..5e67ff75d57b44432f3a726b251b8bcd06616cae 100644 (file)
@@ -8,16 +8,18 @@
 package org.opendaylight.openflowjava.protocol.api.keys;
 
 /**
- * @author michal.polkorab
+ * Key for a class type.
  *
+ * @author michal.polkorab
  */
 public class TypeToClassKey {
 
-    private short version;
-    private int type;
+    private final short version;
+    private final int type;
 
     /**
-     * Constructor
+     * Constructor.
+     *
      * @param version wire protocol version
      * @param type message type / code
      */
@@ -54,4 +56,4 @@ public class TypeToClassKey {
         }
         return true;
     }
-}
\ No newline at end of file
+}
index 995fd350300590beccd792b36f644bbadaba6f8f..f5e21489ff70f95aa5a1311e116dde0eec4d1bf4 100644 (file)
@@ -9,8 +9,9 @@
 package org.opendaylight.openflowjava.protocol.api.util;
 
 /**
- * @author michal.polkorab
+ * Conversion utilities.
  *
+ * @author michal.polkorab
  */
 public abstract class BinContent {
 
@@ -19,6 +20,8 @@ public abstract class BinContent {
     }
 
     /**
+     * Converts an int to unsigned long.
+     *
      * @param value input integer value (might be negative)
      * @return int part wrapped in long (always positive)
      */
@@ -27,6 +30,8 @@ public abstract class BinContent {
     }
 
     /**
+     * Converts an unsigned long to int.
+     *
      * @param value input long value
      * @return long cut into int
      */
index 58d6ccd42b0565c62cdfbe261d44ef338d1bcb27..3597caa78637889cccf8fb7034cb914d755e3db4 100644 (file)
@@ -10,66 +10,82 @@ package org.opendaylight.openflowjava.protocol.api.util;
 
 /**
  * Stores common constants.
+ *
  * @author michal.polkorab
  */
-public abstract class EncodeConstants {
-
-    /** Default OF padding (in bytes) */
-    public static final byte PADDING = 8;
-    /** OpenFlow v1.0 wire protocol number */
-    public static final byte OF10_VERSION_ID = 0x01;
-    /** OpenFlow v1.3 wire protocol number */
-    public static final byte OF13_VERSION_ID = 0x04;
-    /** OpenFlow v1.4 wire protocol number */
-    public static final byte OF14_VERSION_ID = 0x05;
-    /** OpenFlow v1.5 wire protocol number */
-    public static final byte OF15_VERSION_ID = 0x06;
-    /** OpenFlow Hello message type value */
-    public static final byte OF_HELLO_MESSAGE_TYPE_VALUE = 0;
-    /** OpenFlow PacketIn message type value */
-    public static final byte OF_PACKETIN_MESSAGE_TYPE_VALUE = 10;
-    /** Index of length in Openflow header */
-    public static final int OFHEADER_LENGTH_INDEX = 2;
-    /** Size of Openflow header */
-    public static final int OFHEADER_SIZE = 8;
-    /** Zero length - used when the length is updated later */
-    public static final int EMPTY_LENGTH = 0;
-
-    /** Length of mac address */
-    public static final byte MAC_ADDRESS_LENGTH = 6;
-    /** Number of groups in ipv4 address */
-    public static final byte GROUPS_IN_IPV4_ADDRESS = 4;
-    /** Number of groups in ipv6 address */
-    public static final byte GROUPS_IN_IPV6_ADDRESS = 8;
-    /** Length of ipv6 address in bytes */
-    public static final byte SIZE_OF_IPV6_ADDRESS_IN_BYTES = (8 * Short.SIZE) / Byte.SIZE;
-
-    /** Length of long in bytes */
-    public static final byte SIZE_OF_LONG_IN_BYTES = Long.SIZE / Byte.SIZE;
-    /** Length of int in bytes */
-    public static final byte SIZE_OF_INT_IN_BYTES = Integer.SIZE / Byte.SIZE;
-    /** Length of short in bytes */
-    public static final byte SIZE_OF_SHORT_IN_BYTES = Short.SIZE / Byte.SIZE;
-    /** Length of byte in bytes */
-    public static final byte SIZE_OF_BYTE_IN_BYTES = Byte.SIZE / Byte.SIZE;
-    /** Length of 3 bytes */
-    public static final byte SIZE_OF_3_BYTES = 3;
-
-    /** Empty (zero) int value */
-    public static final int EMPTY_VALUE = 0;
-    /** Common experimenter value */
-    public static final int EXPERIMENTER_VALUE = 0xFFFF;
-
-    /** OF v1.0 maximal port name length */
-    public static final byte MAX_PORT_NAME_LENGTH = 16;
-
-    /** ONF Approved Extensions Constants */
-    /** Experimenter ID of ONF approved extensions */
-    public static final long ONF_EXPERIMENTER_ID = 0x4F4E4600;
-    /** ONFOXM_ET_TCP_FLAGS value */
-    public static final int ONFOXM_ET_TCP_FLAGS = 42;
-
-    private EncodeConstants() {
-        //not called
-    }
+public interface EncodeConstants {
+
+    /** Default OF padding (in bytes). */
+    byte PADDING = 8;
+
+    /** OpenFlow v1.0 wire protocol number. */
+    byte OF10_VERSION_ID = 0x01;
+
+    /** OpenFlow v1.3 wire protocol number. */
+    byte OF13_VERSION_ID = 0x04;
+
+    /** OpenFlow v1.4 wire protocol number. */
+    byte OF14_VERSION_ID = 0x05;
+
+    /** OpenFlow v1.5 wire protocol number. */
+    byte OF15_VERSION_ID = 0x06;
+
+    /** OpenFlow Hello message type value. */
+    byte OF_HELLO_MESSAGE_TYPE_VALUE = 0;
+
+    /** OpenFlow PacketIn message type value. */
+    byte OF_PACKETIN_MESSAGE_TYPE_VALUE = 10;
+
+    /** Index of length in Openflow header. */
+    int OFHEADER_LENGTH_INDEX = 2;
+
+    /** Size of Openflow header. */
+    int OFHEADER_SIZE = 8;
+
+    /** Zero length - used when the length is updated later. */
+    int EMPTY_LENGTH = 0;
+
+    /** Length of mac address. */
+    byte MAC_ADDRESS_LENGTH = 6;
+
+    /** Number of groups in ipv4 address. */
+    byte GROUPS_IN_IPV4_ADDRESS = 4;
+
+    /** Number of groups in ipv6 address. */
+    byte GROUPS_IN_IPV6_ADDRESS = 8;
+
+    /** Length of ipv6 address in bytes. */
+    byte SIZE_OF_IPV6_ADDRESS_IN_BYTES = 8 * Short.SIZE / Byte.SIZE;
+
+    /** Length of long in bytes. */
+    byte SIZE_OF_LONG_IN_BYTES = Long.SIZE / Byte.SIZE;
+
+    /** Length of int in bytes. */
+    byte SIZE_OF_INT_IN_BYTES = Integer.SIZE / Byte.SIZE;
+
+    /** Length of short in bytes. */
+    byte SIZE_OF_SHORT_IN_BYTES = Short.SIZE / Byte.SIZE;
+
+    /** Length of byte in bytes. */
+    byte SIZE_OF_BYTE_IN_BYTES = Byte.SIZE / Byte.SIZE;
+
+    /** Length of 3 bytes. */
+    byte SIZE_OF_3_BYTES = 3;
+
+    /** Empty (zero) int value. */
+    int EMPTY_VALUE = 0;
+
+    /** Common experimenter value. */
+    int EXPERIMENTER_VALUE = 0xFFFF;
+
+    /** OF v1.0 maximal port name length. */
+    byte MAX_PORT_NAME_LENGTH = 16;
+
+    // ONF Approved Extensions Constants.
+
+    /** Experimenter ID of ONF approved extensions. */
+    long ONF_EXPERIMENTER_ID = 0x4F4E4600;
+
+    /** ONFOXM_ET_TCP_FLAGS value. */
+    int ONFOXM_ET_TCP_FLAGS = 42;
 }
index e47b70d6630efeba3e424c513c5547b5620f4f4c..051c7d0a9e7a205f9234bb861c53ad6142043dfb 100644 (file)
@@ -9,112 +9,154 @@ package org.opendaylight.openflowjava.protocol.api.util;
 
 /**
  * Stores oxm_match constants.
+ *
  * @author michal.polkorab
  */
-public abstract class OxmMatchConstants {
-
-    /** Backward compatibility with NXM */
-    public static final int NXM_0_CLASS = 0x0000;
-    /** Backward compatibility with NXM */
-    public static final int NXM_1_CLASS = 0x0001;
-    /** Basic class for OpenFlow */
-    public static final int OPENFLOW_BASIC_CLASS = 0x8000;
-    /** Experimenter class */
-    public static final int EXPERIMENTER_CLASS = 0xFFFF;
-
-    /** Switch input port */
-    public static final int IN_PORT = 0;
-    /** Switch physical input port */
-    public static final int IN_PHY_PORT = 1;
-    /** Metadata passed between tables */
-    public static final int METADATA = 2;
-    /** Ethernet destination address */
-    public static final int ETH_DST = 3;
-    /** Ethernet source address */
-    public static final int ETH_SRC = 4;
-    /** Ethernet frame type */
-    public static final int ETH_TYPE = 5;
+public interface OxmMatchConstants {
+
+    /** Backward compatibility with NXM. */
+    int NXM_0_CLASS = 0x0000;
+
+    /** Backward compatibility with NXM. */
+    int NXM_1_CLASS = 0x0001;
+
+    /** Basic class for OpenFlow. */
+    int OPENFLOW_BASIC_CLASS = 0x8000;
+
+    /** Experimenter class. */
+    int EXPERIMENTER_CLASS = 0xFFFF;
+
+    /** Switch input port. */
+    int IN_PORT = 0;
+
+    /** Switch physical input port. */
+    int IN_PHY_PORT = 1;
+
+    /** Metadata passed between tables. */
+    int METADATA = 2;
+
+    /** Ethernet destination address. */
+    int ETH_DST = 3;
+
+    /** Ethernet source address. */
+    int ETH_SRC = 4;
+
+    /** Ethernet frame type. */
+    int ETH_TYPE = 5;
+
     /** VLAN id. */
-    public static final int VLAN_VID = 6;
+    int VLAN_VID = 6;
+
     /** VLAN priority. */
-    public static final int VLAN_PCP = 7;
+    int VLAN_PCP = 7;
+
     /** IP DSCP (6 bits in ToS field). */
-    public static final int IP_DSCP = 8;
+    int IP_DSCP = 8;
+
     /** IP ECN (2 bits in ToS field). */
-    public static final int IP_ECN = 9;
+    int IP_ECN = 9;
+
     /** IP protocol. */
-    public static final int IP_PROTO = 10;
+    int IP_PROTO = 10;
+
     /** IPv4 source address. */
-    public static final int IPV4_SRC = 11;
+    int IPV4_SRC = 11;
+
     /** IPv4 destination address. */
-    public static final int IPV4_DST = 12;
+    int IPV4_DST = 12;
+
     /** TCP source port. */
-    public static final int TCP_SRC = 13;
+    int TCP_SRC = 13;
+
     /** TCP destination port. */
-    public static final int TCP_DST = 14;
+    int TCP_DST = 14;
+
     /** UDP source port. */
-    public static final int UDP_SRC = 15;
+    int UDP_SRC = 15;
+
     /** UDP destination port. */
-    public static final int UDP_DST = 16;
+    int UDP_DST = 16;
+
     /** SCTP source port. */
-    public static final int SCTP_SRC = 17;
+    int SCTP_SRC = 17;
+
     /** SCTP destination port. */
-    public static final int SCTP_DST = 18;
+    int SCTP_DST = 18;
+
     /** ICMP type. */
-    public static final int ICMPV4_TYPE = 19;
+    int ICMPV4_TYPE = 19;
+
     /** ICMP code. */
-    public static final int ICMPV4_CODE = 20;
+    int ICMPV4_CODE = 20;
+
     /** ARP opcode. */
-    public static final int ARP_OP = 21;
+    int ARP_OP = 21;
+
     /** ARP source IPv4 address. */
-    public static final int ARP_SPA = 22;
+    int ARP_SPA = 22;
+
     /** ARP target IPv4 address. */
-    public static final int ARP_TPA = 23;
+    int ARP_TPA = 23;
+
     /** ARP source hardware address. */
-    public static final int ARP_SHA = 24;
+    int ARP_SHA = 24;
+
     /** ARP target hardware address. */
-    public static final int ARP_THA = 25;
+    int ARP_THA = 25;
+
     /** IPv6 source address. */
-    public static final int IPV6_SRC = 26;
+    int IPV6_SRC = 26;
+
     /** IPv6 destination address. */
-    public static final int IPV6_DST = 27;
-    /** IPv6 Flow Label */
-    public static final int IPV6_FLABEL = 28;
+    int IPV6_DST = 27;
+
+    /** IPv6 Flow Label. */
+    int IPV6_FLABEL = 28;
+
     /** ICMPv6 type. */
-    public static final int ICMPV6_TYPE = 29;
+    int ICMPV6_TYPE = 29;
+
     /** ICMPv6 code. */
-    public static final int ICMPV6_CODE = 30;
+    int ICMPV6_CODE = 30;
+
     /** Target address for ND. */
-    public static final int IPV6_ND_TARGET = 31;
+    int IPV6_ND_TARGET = 31;
+
     /** Source link-layer for ND. */
-    public static final int IPV6_ND_SLL = 32;
+    int IPV6_ND_SLL = 32;
+
     /** Target link-layer for ND. */
-    public static final int IPV6_ND_TLL = 33;
+    int IPV6_ND_TLL = 33;
+
     /** MPLS label. */
-    public static final int MPLS_LABEL = 34;
+    int MPLS_LABEL = 34;
+
     /** MPLS TC. */
-    public static final int MPLS_TC = 35;
+    int MPLS_TC = 35;
+
     /** MPLS BoS bit. */
-    public static final int MPLS_BOS = 36;
+    int MPLS_BOS = 36;
+
     /** PBB I-SID. */
-    public static final int PBB_ISID = 37;
+    int PBB_ISID = 37;
+
     /** Logical Port Metadata. */
-    public static final int TUNNEL_ID = 38;
-    /** IPv6 Extension Header pseudo-field */
-    public static final int IPV6_EXTHDR = 39;
+    int TUNNEL_ID = 38;
+
+    /** IPv6 Extension Header pseudo-field. */
+    int IPV6_EXTHDR = 39;
 
     /**
-     * OFPXMC_NXM_1 class Constants
+     * OFPXMC_NXM_1 class Constants.
      */
 
-    /** NXM IPv4 Tunnel Endpoint Source */
-    public static final int NXM_NX_TUN_IPV4_SRC = 31;
-    /** NXM IPv4 Tunnel Endpoint Destination */
-    public static final int NXM_NX_TUN_IPV4_DST = 32;
-    /** NXM TCP_Flag value */
-    public static final int NXM_NX_TCP_FLAG = 34;
-
-    private OxmMatchConstants() {
-        //not called
-    }
-}
\ No newline at end of file
+    /** NXM IPv4 Tunnel Endpoint Source. */
+    int NXM_NX_TUN_IPV4_SRC = 31;
+
+    /** NXM IPv4 Tunnel Endpoint Destination.
+     *  */
+    int NXM_NX_TUN_IPV4_DST = 32;
+
+    /** NXM TCP_Flag value. */
+    int NXM_NX_TCP_FLAG = 34;
+}
index be52a18890fee87dc2ac33ece16d42f8efad2ed2..6c729cee56ecb91fce56864b6832e50c748f5e74 100644 (file)
@@ -8,28 +8,28 @@
 
 package org.opendaylight.openflowjava.protocol.api.connection;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
 
+import com.google.common.collect.Lists;
 import java.util.List;
-
 import org.junit.Test;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.KeystoreType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.PathType;
 
-import com.google.common.collect.Lists;
-
 /**
- * @author michal.polkorab
+ * Unit tests for TlsConfigurationImpl.
  *
+ * @author michal.polkorab
  */
 public class TlsConfigurationImplTest {
 
     /**
-     * Test correct TlsConfigurationImpl creation
+     * Test correct TlsConfigurationImpl creation.
      */
     @Test
     public void test() {
-        List<String> cipherSuites = Lists.newArrayList("TLS_RSA_WITH_AES_128_CBC_SHA", "TLS_RSA_WITH_AES_128_CBC_SHA256");
+        List<String> cipherSuites = Lists.newArrayList("TLS_RSA_WITH_AES_128_CBC_SHA",
+                "TLS_RSA_WITH_AES_128_CBC_SHA256");
         TlsConfigurationImpl config = new TlsConfigurationImpl(KeystoreType.JKS,
                 "user/dir", PathType.CLASSPATH, KeystoreType.PKCS12, "/var/lib", PathType.PATH, cipherSuites);
         assertEquals("Wrong keystore location", "/var/lib", config.getTlsKeystore());
@@ -43,4 +43,4 @@ public class TlsConfigurationImplTest {
         assertEquals("Wrong truststore password", "opendaylight", config.getTruststorePassword());
         assertEquals("Wrong cipher suites", cipherSuites, config.getCipherSuites());
     }
-}
\ No newline at end of file
+}
index 6e08c1e4d4e71a32a107270922564994631fbbb0..6cd781256547477e28343f7e1b8f46c8d785546e 100644 (file)
@@ -15,13 +15,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierOutput;
 
 /**
- * @author michal.polkorab
+ * Unit tests for EnhancedMessageCodeKey.
  *
+ * @author michal.polkorab
  */
 public class EnhancedMessageCodeKeyTest {
 
     /**
-     * Test EnhancedMessageCodeKey equals and hashCode
+     * Test EnhancedMessageCodeKey equals and hashCode.
      */
     @Test
     public void test() {
@@ -49,7 +50,7 @@ public class EnhancedMessageCodeKeyTest {
     }
 
     /**
-     * Test EnhancedMessageTypeKey equals - additional test
+     * Test EnhancedMessageTypeKey equals - additional test.
      */
     @Test
     public void testEquals() {
@@ -61,14 +62,15 @@ public class EnhancedMessageCodeKeyTest {
     }
 
     /**
-     * Test EnhancedMessageCodeKey toString()
+     * Test EnhancedMessageCodeKey toString().
      */
     @Test
     public void testToString() {
         EnhancedMessageCodeKey key1 =
                 new EnhancedMessageCodeKey(EncodeConstants.OF10_VERSION_ID, 4, 8, BarrierInput.class);
 
-        Assert.assertEquals("Wrong toString()", "msgVersion: 1 objectClass: org.opendaylight.yang.gen.v1.urn.opendaylight"
+        Assert.assertEquals("Wrong toString()",
+                "msgVersion: 1 objectClass: org.opendaylight.yang.gen.v1.urn.opendaylight"
                 + ".openflow.protocol.rev130731.BarrierInput msgType: 4 msgType2: 8", key1.toString());
     }
 }
index eb19e7ffd7b13d36fcbabec52e82544d431f2277..939a80104051e54d2bc9d72a8fec142aa802ad27 100644 (file)
@@ -17,13 +17,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev1
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
 
 /**
- * @author michal.polkorab
+ * Unit tests for EnhancedMessageTypeKey.
  *
+ * @author michal.polkorab
  */
 public class EnhancedMessageTypeKeyTest {
 
     /**
-     * Test EnhancedMessageTypeKey equals and hashCode
+     * Test EnhancedMessageTypeKey equals and hashCode.
      */
     @Test
     public void test() {
@@ -51,7 +52,7 @@ public class EnhancedMessageTypeKeyTest {
     }
 
     /**
-     * Test EnhancedMessageTypeKey equals - additional test
+     * Test EnhancedMessageTypeKey equals - additional test.
      */
     @Test
     public void testEquals() {
@@ -71,7 +72,7 @@ public class EnhancedMessageTypeKeyTest {
     }
 
     /**
-     * Test EnhancedMessageTypeKey toString()
+     * Test EnhancedMessageTypeKey toString().
      */
     @Test
     public void testToString() {
index 2c5b69c6e9a3236d5e7f7695c4ab8761fb0622c2..32604181efec99048867b1bdc431644786fd7598 100644 (file)
@@ -16,13 +16,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierOutput;
 
 /**
- * @author michal.polkorab
+ * Unit tests for MessageCodeKey.
  *
+ * @author michal.polkorab
  */
 public class MessageCodeKeyTest {
 
     /**
-     * Test MessageCodeKey equals and hashCode
+     * Test MessageCodeKey equals and hashCode.
      */
     @Test
     public void test() {
@@ -47,7 +48,7 @@ public class MessageCodeKeyTest {
     }
 
     /**
-     * Test MessageCodeKey equals - additional test
+     * Test MessageCodeKey equals - additional test.
      */
     @Test
     public void testEquals() {
@@ -66,7 +67,7 @@ public class MessageCodeKeyTest {
     }
 
     /**
-     * Test MessageCodeKey toString()
+     * Test MessageCodeKey toString().
      */
     @Test
     public void testToString() {
@@ -75,4 +76,4 @@ public class MessageCodeKeyTest {
         Assert.assertEquals("Wrong toString()", "msgVersion: 1 objectClass: org.opendaylight.yang.gen.v1.urn"
                 + ".opendaylight.openflow.protocol.rev130731.BarrierInput msgType: 4", key1.toString());
     }
-}
\ No newline at end of file
+}
index 7a45015a524e5cfb96b9afe30a8e15b586697434..d997fa5aac73a55d2edef07b53964b074a62c09f 100644 (file)
@@ -16,13 +16,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierOutput;
 
 /**
- * @author michal.polkorab
+ * Unit tests for MessageTypeKey.
  *
+ * @author michal.polkorab
  */
 public class MessageTypeKeyTest {
 
     /**
-     * Test MessageTypeKey equals and hashCode
+     * Test MessageTypeKey equals and hashCode.
      */
     @Test
     public void test() {
@@ -44,20 +45,18 @@ public class MessageTypeKeyTest {
     }
 
     /**
-     * Test MessageTypeKey equals - additional test
+     * Test MessageTypeKey equals - additional test.
      */
     @Test
     public void testEquals() {
-        MessageTypeKey<?> key1;
-        MessageTypeKey<?> key2;
-        key1 = new MessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, BarrierInput.class);
+        MessageTypeKey<?> key1 = new MessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, BarrierInput.class);
 
         Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1));
         Assert.assertFalse("Wrong equal to null.", key1.equals(null));
         Assert.assertFalse("Wrong equal to different class.", key1.equals(new Object()));
 
         key1 = new MessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, null);
-        key2 = new MessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, BarrierInput.class);
+        MessageTypeKey<?> key2 = new MessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, BarrierInput.class);
         Assert.assertFalse("Wrong equal by msgType.", key1.equals(key2));
 
         key2 = new MessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, null);
@@ -65,7 +64,7 @@ public class MessageTypeKeyTest {
     }
 
     /**
-     * Test MessageTypeKey toString()
+     * Test MessageTypeKey toString().
      */
     @Test
     public void testToString() {
index 84760e8b845a6a11856f0d0359e7099514976a51..94f0609e4f60d514f6bd66ad4e3ff92d78babf73 100644 (file)
@@ -13,13 +13,14 @@ import org.junit.Test;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 
 /**
- * @author michal.polkorab
+ * Unit tests for ActionDeserializerKey.
  *
+ * @author michal.polkorab
  */
 public class ActionDeserializerKeyTest {
 
     /**
-     * Test ActionDeserializerKey equals and hashCode
+     * Test ActionDeserializerKey equals and hashCode.
      */
     @Test
     public void test() {
@@ -42,10 +43,10 @@ public class ActionDeserializerKeyTest {
     }
 
     /**
-     * Test ActionDeserializerKey equals - additional test
+     * Test ActionDeserializerKey equals - additional test.
      */
     @Test
-    public void testEquals(){
+    public void testEquals() {
         ActionDeserializerKey key1 = new ActionDeserializerKey(EncodeConstants.OF10_VERSION_ID, 11, null);
         ActionDeserializerKey key2 = new ActionDeserializerKey(EncodeConstants.OF10_VERSION_ID, 11, 42L);
 
@@ -57,14 +58,14 @@ public class ActionDeserializerKeyTest {
     }
 
     /**
-     * Test InstructionDeserializerKey toString()
+     * Test InstructionDeserializerKey toString().
      */
     @Test
-    public void testToString(){
+    public void testToString() {
         ActionDeserializerKey key1 = new ActionDeserializerKey(EncodeConstants.OF10_VERSION_ID, 11, null);
 
         Assert.assertEquals("Wrong toString()", "msgVersion: 1 objectClass: org.opendaylight.yang.gen.v1.urn"
                 + ".opendaylight.openflow.common.action.rev150203.actions.grouping.Action msgType: 11"
                 + " experimenterID: null", key1.toString());
     }
-}
\ No newline at end of file
+}
index 9fdde0ae6c9765b3319f44c15a18763fb29b816d..8fbd6f317de7b7a9e54c31a41c51dc8cb894d987 100644 (file)
@@ -15,13 +15,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev1
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.CopyTtlOutCase;
 
 /**
- * @author michal.polkorab
+ * Unit tests for ActionSerializerKey.
  *
+ * @author michal.polkorab
  */
 public class ActionSerializerKeyTest {
 
     /**
-     * Test ActionSerializerKey equals and hashCode
+     * Test ActionSerializerKey equals and hashCode.
      */
     @Test
     public void test() {
@@ -49,10 +50,10 @@ public class ActionSerializerKeyTest {
     }
 
     /**
-     * Test ActionSerializerKey equals - additional test
+     * Test ActionSerializerKey equals - additional test.
      */
     @Test
-    public void testEquals(){
+    public void testEquals() {
         ActionSerializerKey<?> key1 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, null, 42L);
         ActionSerializerKey<?> key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID,
                 CopyTtlInCase.class, 42L);
@@ -69,10 +70,10 @@ public class ActionSerializerKeyTest {
     }
 
     /**
-     * Test ActionSerializerKey toString()
+     * Test ActionSerializerKey toString().
      */
     @Test
-    public void testToString(){
+    public void testToString() {
         ActionSerializerKey<CopyTtlInCase> key1 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID,
                 CopyTtlInCase.class, 42L);
 
index 6b501a1cf074d0c695d9ff4413c017062b9ff39f..b99c2aa2d7b2e70ec4737354823c320be79a988b 100644 (file)
@@ -13,13 +13,14 @@ import org.junit.Test;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 
 /**
- * @author michal.polkorab
+ * Unit tests for InstructionDeserializerKey.
  *
+ * @author michal.polkorab
  */
 public class InstructionDeserializerKeyTest {
 
     /**
-     * Test InstructionDeserializerKey equals and hashCode
+     * Test InstructionDeserializerKey equals and hashCode.
      */
     @Test
     public void test() {
@@ -42,10 +43,10 @@ public class InstructionDeserializerKeyTest {
     }
 
     /**
-     * Test InstructionDeserializerKey equals - additional test
+     * Test InstructionDeserializerKey equals - additional test.
      */
     @Test
-    public void testEquals(){
+    public void testEquals() {
         InstructionDeserializerKey key1 = new InstructionDeserializerKey(EncodeConstants.OF10_VERSION_ID, 11, null);
         InstructionDeserializerKey key2 = new InstructionDeserializerKey(EncodeConstants.OF10_VERSION_ID, 11, 24L);
 
@@ -57,14 +58,15 @@ public class InstructionDeserializerKeyTest {
     }
 
     /**
-     * Test InstructionDeserializerKey toString()
+     * Test InstructionDeserializerKey toString().
      */
     @Test
-    public void testToString(){
+    public void testToString() {
         InstructionDeserializerKey key1 = new InstructionDeserializerKey(EncodeConstants.OF10_VERSION_ID, 11, null);
 
-        Assert.assertEquals("Wrong toString()", "msgVersion: 1 objectClass: org.opendaylight.yang.gen.v1.urn.opendaylight"
+        Assert.assertEquals("Wrong toString()",
+                "msgVersion: 1 objectClass: org.opendaylight.yang.gen.v1.urn.opendaylight"
                 + ".openflow.common.instruction.rev130731.instructions.grouping.Instruction msgType: 11"
                 + " experimenterID: null", key1.toString());
     }
-}
\ No newline at end of file
+}
index 17ecf58222b0e37163a28e0cee7bbdb66a219c57..ab317e8de78e01319c6f3a433eb3fdca904d3d83 100644 (file)
@@ -15,19 +15,20 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.WriteActionsCase;
 
 /**
- * @author michal.polkorab
+ * Unit tests for InstructionSerializerKey.
  *
+ * @author michal.polkorab
  */
 public class InstructionSerializerKeyTest {
 
     /**
-     * Test InstructionSerializerKey equals and hashCode
+     * Test InstructionSerializerKey equals and hashCode.
      */
     @Test
     public void test() {
         InstructionSerializerKey<?> key1 =
                 new InstructionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, ApplyActionsCase.class, 42L);
-                InstructionSerializerKey<?> key2 =
+        InstructionSerializerKey<?> key2 =
                 new InstructionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, ApplyActionsCase.class, 42L);
         Assert.assertTrue("Wrong equals", key1.equals(key2));
         Assert.assertTrue("Wrong hashCode", key1.hashCode() == key2.hashCode());
@@ -49,18 +50,18 @@ public class InstructionSerializerKeyTest {
     }
 
     /**
-     * Test InstructionSerializerKey equals  - additional test
+     * Test InstructionSerializerKey equals  - additional test.
      */
     @Test
-    public void testEquals(){
+    public void testEquals() {
         InstructionSerializerKey<?> key1 =
                 new InstructionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, ApplyActionsCase.class, 42L);
-        InstructionSerializerKey<?> key2 =
-                new InstructionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, ApplyActionsCase.class, 42L);
 
         Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1));
         Assert.assertFalse("Wrong equal to different class.", key1.equals(new Object()));
 
+        InstructionSerializerKey<?> key2 =
+                new InstructionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, ApplyActionsCase.class, 42L);
         key1 = new InstructionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, ApplyActionsCase.class, null);
         Assert.assertFalse("Wrong equal by experimenterId.", key1.equals(key2));
 
@@ -70,10 +71,10 @@ public class InstructionSerializerKeyTest {
     }
 
     /**
-     * Test InstructionSerializerKey toString()
+     * Test InstructionSerializerKey toString().
      */
     @Test
-    public void testToString(){
+    public void testToString() {
         InstructionSerializerKey<?> key1 =
                 new InstructionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, ApplyActionsCase.class, 42L);
 
@@ -82,4 +83,4 @@ public class InstructionSerializerKeyTest {
                 + "instructionType type: org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction"
                 + ".rev130731.instruction.grouping.instruction.choice.ApplyActionsCase vendorID: 42", key1.toString());
     }
-}
\ No newline at end of file
+}
index d2aefedbf5dd335709be3a13bf5df1a9a72e0449..77905065f182605dc7c509b2ea4aedd16ea58ef1 100644 (file)
@@ -17,12 +17,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.InPo
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
 
 /**
+ * Unit tests for keys.
+ *
  * @author michal.polkorab
  */
 public class KeysTest {
 
     /**
-     * Testing equals() and hashcode() methods of extension deserializer's keys
+     * Testing equals() and hashcode() methods of extension deserializer's keys.
      */
     @Test
     public void testEqualsAndHashcodeOfDeserializerKeys() {
@@ -35,7 +37,8 @@ public class KeysTest {
 
         InstructionDeserializerKey instructionDeserializerKey = new InstructionDeserializerKey(
                 EncodeConstants.OF13_VERSION_ID, EncodeConstants.EXPERIMENTER_VALUE, 1L);
-        ExperimenterInstructionDeserializerKey experimenterInstructionDeserializerKey = new ExperimenterInstructionDeserializerKey(
+        ExperimenterInstructionDeserializerKey experimenterInstructionDeserializerKey =
+                new ExperimenterInstructionDeserializerKey(
                 EncodeConstants.OF13_VERSION_ID, 1L);
         Assert.assertEquals(instructionDeserializerKey, experimenterInstructionDeserializerKey);
         Assert.assertEquals(instructionDeserializerKey.hashCode(), experimenterInstructionDeserializerKey.hashCode());
@@ -49,7 +52,7 @@ public class KeysTest {
     }
 
     /**
-     * Testing equals() and hashcode() methods of extension serializer's keys
+     * Testing equals() and hashcode() methods of extension serializer's keys.
      */
     @Test
     public void testEqualsAndHashcodeOfActionDeserializerKeys() {
@@ -61,11 +64,12 @@ public class KeysTest {
         Assert.assertFalse(experimenterActionSerializerKey.equals(actionSerializerKey));
 
         InstructionSerializerKey<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225
-        .instruction.container.instruction.choice.ExperimenterIdCase> instructionSerializerKey =
+            .instruction.container.instruction.choice.ExperimenterIdCase> instructionSerializerKey =
                 new InstructionSerializerKey<>(EncodeConstants.OF13_VERSION_ID, org.opendaylight.yang.gen.v1.urn
                         .opendaylight.openflow.augments.rev150225.instruction.container.instruction.choice
                         .ExperimenterIdCase.class, 1L);
-        ExperimenterInstructionSerializerKey experimenterInstructionSerializerKey = new ExperimenterInstructionSerializerKey(EncodeConstants.OF13_VERSION_ID, 1L);
+        ExperimenterInstructionSerializerKey experimenterInstructionSerializerKey =
+                new ExperimenterInstructionSerializerKey(EncodeConstants.OF13_VERSION_ID, 1L);
         Assert.assertEquals(instructionSerializerKey, experimenterInstructionSerializerKey);
         Assert.assertEquals(instructionSerializerKey.hashCode(), experimenterInstructionSerializerKey.hashCode());
 
index ceefbc1b493d52502fca96b5dc2a1646b1b62e20..abf181c8567951ac8db9873b1355b04647f0bbf3 100644 (file)
@@ -13,13 +13,14 @@ import org.junit.Test;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 
 /**
- * @author michal.polkorab
+ * Unit tests for MatchEntryDeserializerKey.
  *
+ * @author michal.polkorab
  */
 public class MatchEntryDeserializerKeyTest {
 
     /**
-     * Test MatchEntryDeserializerKey equals and hashCode
+     * Test MatchEntryDeserializerKey equals and hashCode.
      */
     @Test
     public void test() {
@@ -48,32 +49,33 @@ public class MatchEntryDeserializerKeyTest {
     }
 
     /**
-     * Test MatchEntryDeserializerKey equals - additional test
+     * Test MatchEntryDeserializerKey equals - additional test.
      */
     @Test
     public void testEquals() {
         MatchEntryDeserializerKey key1 = new MatchEntryDeserializerKey(EncodeConstants.OF10_VERSION_ID, 0x8000, 42);
-        MatchEntryDeserializerKey key2 = new MatchEntryDeserializerKey(EncodeConstants.OF10_VERSION_ID, 0x8000, 42);
 
         Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1));
         Assert.assertFalse("Wrong equal to different class.", key1.equals(new Object()));
 
-        Long expId1=123456L;
-        Long expId2=654321L;
+        MatchEntryDeserializerKey key2 = new MatchEntryDeserializerKey(EncodeConstants.OF10_VERSION_ID, 0x8000, 42);
+
+        Long expId2 = 654321L;
         key1.setExperimenterId(null);
         key2.setExperimenterId(expId2);
         Assert.assertFalse("Wrong equal by experimeterId.", key1.equals(key2));
 
+        Long expId1 = 123456L;
         key1.setExperimenterId(expId1);
         Assert.assertFalse("Wrong equal by experimeterId.", key1.equals(key2));
         Assert.assertFalse("Wrong equals with different object class", key1.equals(key2));
     }
 
     /**
-     * Test MatchEntryDeserializerKey toString()
+     * Test MatchEntryDeserializerKey toString().
      */
     @Test
-    public void testToString(){
+    public void testToString() {
         MatchEntryDeserializerKey key1 = new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, 0x8000, 42);
 
         Assert.assertEquals("Wrong toString()", "msgVersion: 4 objectClass: org.opendaylight.yang.gen.v1.urn"
index fbd5e26adc37cbcae01d0fd65270e0b395204495..cafbed0a1955f016e734ab6b0d48e81cc89ec6e5 100644 (file)
@@ -17,20 +17,21 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm0
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
 
 /**
- * @author michal.polkorab
+ * Unit tests for MatchEntrySerializerKey.
  *
+ * @author michal.polkorab
  */
 public class MatchEntrySerializerKeyTest {
 
     /**
-     * Test MatchEntrySerializerKey equals and hashCode
+     * Test MatchEntrySerializerKey equals and hashCode.
      */
     @Test
     public void test() {
-        MatchEntrySerializerKey<?, ?> key1 = new MatchEntrySerializerKey<>
-                (EncodeConstants.OF13_VERSION_ID, OpenflowBasicClass.class, InPort.class);
-        MatchEntrySerializerKey<?, ?> key2 = new MatchEntrySerializerKey<>
-                (EncodeConstants.OF13_VERSION_ID, OpenflowBasicClass.class, InPort.class);
+        MatchEntrySerializerKey<?, ?> key1 = new MatchEntrySerializerKey<>(
+                EncodeConstants.OF13_VERSION_ID, OpenflowBasicClass.class, InPort.class);
+        MatchEntrySerializerKey<?, ?> key2 = new MatchEntrySerializerKey<>(
+                EncodeConstants.OF13_VERSION_ID, OpenflowBasicClass.class, InPort.class);
         Assert.assertTrue("Wrong equals", key1.equals(key2));
         Assert.assertTrue("Wrong hashCode", key1.hashCode() == key2.hashCode());
         key2 = new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID,
@@ -58,10 +59,10 @@ public class MatchEntrySerializerKeyTest {
     }
 
     /**
-     * Test MatchEntrySerializerKey equals - additional test
+     * Test MatchEntrySerializerKey equals - additional test.
      */
     @Test
-    public void testEquals(){
+    public void testEquals() {
         MatchEntrySerializerKey<?, ?> key1;
         MatchEntrySerializerKey<?, ?> key2;
         key1 = new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, OpenflowBasicClass.class, InPort.class);
@@ -69,12 +70,13 @@ public class MatchEntrySerializerKeyTest {
         Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1));
         Assert.assertFalse("Wrong equal to different class.", key1.equals(new Object()));
 
-        Long expId1 = 987654331L;
         Long expId2 = 123456789L;
 
         key1.setExperimenterId(null);
         key2.setExperimenterId(expId2);
         Assert.assertFalse("Wrong equal by experimenterId", key1.equals(key2));
+
+        Long expId1 = 987654331L;
         key1.setExperimenterId(expId1);
         Assert.assertFalse("Wrong equal by experimenterId", key1.equals(key2));
         key1 = new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, null, InPort.class);
@@ -92,10 +94,10 @@ public class MatchEntrySerializerKeyTest {
     }
 
     /**
-     * Test MatchEntrySerializerKey toString()
+     * Test MatchEntrySerializerKey toString().
      */
     @Test
-    public void testToString(){
+    public void testToString() {
         MatchEntrySerializerKey<?, ?> key1;
         key1 = new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, OpenflowBasicClass.class, InPort.class);
 
@@ -105,4 +107,4 @@ public class MatchEntrySerializerKeyTest {
                 + ".OpenflowBasicClass oxm_field: org.opendaylight.yang.gen.v1.urn.opendaylight.openflow"
                 + ".oxm.rev150225.InPort experimenterID: null", key1.toString());
     }
-}
\ No newline at end of file
+}
index 8b6192d3bed696b2dd1b9cf5c30c600525571558..c161714a3bb0e4f116c07454aeca3bb8e3ff02d2 100644 (file)
@@ -11,18 +11,19 @@ package org.opendaylight.openflowjava.protocol.api.keys;
 import org.junit.Assert;
 import org.junit.Test;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+
 /**
+ * Unit tests for TypeToClassKey.
  *
  * @author madamjak
- *
  */
 public class TypeToClassKeyTest {
 
     /**
-     * Test equals
+     * Test equals.
      */
     @Test
-    public void test(){
+    public void test() {
         final short ver10 = EncodeConstants.OF10_VERSION_ID;
         final short ver13 = EncodeConstants.OF13_VERSION_ID;
         final int type1 = 1;
index 97543feabfca3a8eab83354a0bd9361f6ed10945..4374c3502e981494e16c05081832dc3641368365 100644 (file)
@@ -14,13 +14,14 @@ import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterActionDeseria
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 
 /**
- * @author michal.polkorab
+ * Unit tests for ExperimenterActionDeserializerKey.
  *
+ * @author michal.polkorab
  */
 public class ExperimenterActionDeserializerKeyTest {
 
     /**
-     * Test ExperimenterActionDeserializerKey equals and hashCode
+     * Test ExperimenterActionDeserializerKey equals and hashCode.
      */
     @Test
     public void test() {
@@ -40,4 +41,4 @@ public class ExperimenterActionDeserializerKeyTest {
         Assert.assertFalse("Wrong equals", key1.equals(key2));
         Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
     }
-}
\ No newline at end of file
+}
index e3e910cac4430f5c2d668493b94ecde221777cb7..445da67a21303903388ab8856e92452baa03aca2 100644 (file)
@@ -15,14 +15,14 @@ import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.ExperimenterActionSubType;
 
 /**
- * @author michal.polkorab
+ * Unit tests for ExperimenterActionSerializerKey.
  *
+ * @author michal.polkorab
  */
 public class ExperimenterActionSerializerKeyTest {
 
-
     /**
-     * Test ExperimenterActionSerializerKey equals and hashCode
+     * Test ExperimenterActionSerializerKey equals and hashCode.
      */
     @Test
     public void test() {
@@ -50,7 +50,7 @@ public class ExperimenterActionSerializerKeyTest {
     }
 
     /**
-     * Test ExperimenterActionSerializerKey equals
+     * Test ExperimenterActionSerializerKey equals.
      */
     @Test
     public void testEquals() {
@@ -74,4 +74,4 @@ public class ExperimenterActionSerializerKeyTest {
     }
 
 
-}
\ No newline at end of file
+}
index d7f61084c4661890e7bfd9bacf3320c95e047b3e..9b5befc3397123794c041261c6b676509b2536bb 100644 (file)
@@ -17,13 +17,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterMessage;
 
 /**
- * @author michal.polkorab
+ * Unit tests for ExperimenterIdDeserializerKey.
  *
+ * @author michal.polkorab
  */
 public class ExperimenterIdDeserializerKeyTest {
 
     /**
-     * Test ExperimenterIdDeserializerKey equals and hashCode
+     * Test ExperimenterIdDeserializerKey equals and hashCode.
      */
     @Test
     public void test() {
@@ -51,14 +52,15 @@ public class ExperimenterIdDeserializerKeyTest {
     }
 
     /**
-     * Test ExperimenterIdDeserializerKey equals - additional test
+     * Test ExperimenterIdDeserializerKey equals - additional test.
      */
     @Test
     public void testEquals() {
         ExperimenterIdDeserializerKey key1 =
                 new ExperimenterIdDeserializerKey(EncodeConstants.OF10_VERSION_ID, 0L, ExperimenterMessage.class);
         Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1));
-        MessageCodeKey mk = new MessageCodeKey(EncodeConstants.OF10_VERSION_ID,EncodeConstants.EXPERIMENTER_VALUE, ExperimenterMessage.class);
+        MessageCodeKey mk = new MessageCodeKey(EncodeConstants.OF10_VERSION_ID,
+                EncodeConstants.EXPERIMENTER_VALUE, ExperimenterMessage.class);
         Assert.assertFalse("Wrong equal to different class.", key1.equals(mk));
         ExperimenterIdDeserializerKey key2 =
                 new ExperimenterIdDeserializerKey(EncodeConstants.OF10_VERSION_ID, 42L, ExperimenterMessage.class);
index a3bf78913832530d34bec6fdd34b040dc4501c19..c5239a01ae34b3f14c44b91f742ad4bc369a962c 100644 (file)
@@ -17,13 +17,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterMessage;
 
 /**
- * @author michal.polkorab
+ * Unit tests for ExperimenterIdSerializerKey.
  *
+ * @author michal.polkorab
  */
 public class ExperimenterIdSerializerKeyTest {
 
     /**
-     * Test ExperimenterIdSerializerKey equals and hashCode
+     * Test ExperimenterIdSerializerKey equals and hashCode.
      */
     @Test
     public void testHashCodeAndEquals() {
@@ -48,18 +49,18 @@ public class ExperimenterIdSerializerKeyTest {
     }
 
     /**
-     * Test ExperimenterIdSerializerKey equals - additional test
+     * Test ExperimenterIdSerializerKey equals - additional test.
      */
     @Test
     public void testEquals() {
         ExperimenterIdSerializerKey<?> key1 =
                 new ExperimenterIdSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 41L, ExperimenterMessage.class);
         Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1));
-        MessageTypeKey<?>mk = new MessageTypeKey<>(EncodeConstants.OF10_VERSION_ID,ExperimenterMessage.class);
+        MessageTypeKey<?> mk = new MessageTypeKey<>(EncodeConstants.OF10_VERSION_ID,ExperimenterMessage.class);
         Assert.assertFalse("Wrong equal to different class.", key1.equals(mk));
         ExperimenterIdSerializerKey<?> key2 =
                 new ExperimenterIdSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 42L, ExperimenterMessage.class);
         Assert.assertFalse("Wrong equal by experimenterId.", key1.equals(key2));
     }
 
-}
\ No newline at end of file
+}
index 7405b7734c6bc18d851572e9b419bd8d41b3f3a5..dc69f8b8b70d85bbca956ad8f99abbd69e0353d1 100644 (file)
@@ -17,25 +17,29 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterMessage;
 
 /**
+ * Unit tests for ExperimenterIdTypeDeserializerKey.
+ *
  * @author michal.polkorab
  */
 public class ExperimenterIdTypeDeserializerKeyTest {
 
     /**
-     * Test ExperimenterIdTypeDeserializerKey equals and hashCode
+     * Test ExperimenterIdTypeDeserializerKey equals and hashCode.
      */
     @Test
     public void testHashCodeAndEquals() {
-        ExperimenterIdTypeDeserializerKey key1 =
-                new ExperimenterIdTypeDeserializerKey(EncodeConstants.OF10_VERSION_ID, 42L, 1L, ExperimenterMessage.class);
-        ExperimenterIdTypeDeserializerKey key2 =
-                new ExperimenterIdTypeDeserializerKey(EncodeConstants.OF10_VERSION_ID, 42L, 1L, ExperimenterMessage.class);
+        ExperimenterIdTypeDeserializerKey key1 = new ExperimenterIdTypeDeserializerKey(EncodeConstants.OF10_VERSION_ID,
+                42L, 1L, ExperimenterMessage.class);
+        ExperimenterIdTypeDeserializerKey key2 = new ExperimenterIdTypeDeserializerKey(EncodeConstants.OF10_VERSION_ID,
+                42L, 1L, ExperimenterMessage.class);
         Assert.assertTrue("Wrong equals", key1.equals(key2));
         Assert.assertTrue("Wrong hashcode", key1.hashCode() == key2.hashCode());
-        key2 = new ExperimenterIdTypeDeserializerKey(EncodeConstants.OF13_VERSION_ID, 42L, 1L, ExperimenterMessage.class);
+        key2 = new ExperimenterIdTypeDeserializerKey(EncodeConstants.OF13_VERSION_ID, 42L, 1L,
+                ExperimenterMessage.class);
         Assert.assertFalse("Wrong equals", key1.equals(key2));
         Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
-        key2 = new ExperimenterIdTypeDeserializerKey(EncodeConstants.OF10_VERSION_ID, 55L, 1L, ExperimenterMessage.class);
+        key2 = new ExperimenterIdTypeDeserializerKey(EncodeConstants.OF10_VERSION_ID, 55L, 1L,
+                ExperimenterMessage.class);
         Assert.assertFalse("Wrong equals", key1.equals(key2));
         Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
         key2 = new ExperimenterIdTypeDeserializerKey(EncodeConstants.OF10_VERSION_ID, 55L, 1L, null);
@@ -45,28 +49,30 @@ public class ExperimenterIdTypeDeserializerKeyTest {
         Assert.assertFalse("Wrong equals", key1.equals(key2));
         Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
 
-        key2 = new ExperimenterIdTypeDeserializerKey(EncodeConstants.OF10_VERSION_ID, 42L, 2L, ExperimenterMessage.class);
+        key2 = new ExperimenterIdTypeDeserializerKey(EncodeConstants.OF10_VERSION_ID, 42L, 2L,
+                ExperimenterMessage.class);
         Assert.assertFalse("Wrong equals", key1.equals(key2));
         Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
     }
 
     /**
-     * Test ExperimenterIdTypeDeserializerKey equals - additional test
+     * Test ExperimenterIdTypeDeserializerKey equals - additional test.
      */
     @Test
     public void testEquals() {
-        ExperimenterIdTypeDeserializerKey key1 =
-                new ExperimenterIdTypeDeserializerKey(EncodeConstants.OF10_VERSION_ID, 41L, 1L, ExperimenterMessage.class);
+        ExperimenterIdTypeDeserializerKey key1 = new ExperimenterIdTypeDeserializerKey(EncodeConstants.OF10_VERSION_ID,
+                41L, 1L, ExperimenterMessage.class);
         Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1));
-        ExperimenterIdSerializerKey<?> mk = new ExperimenterIdSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 42L, ExperimenterMessage.class);
+        ExperimenterIdSerializerKey<?> mk = new ExperimenterIdSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 42L,
+                ExperimenterMessage.class);
         Assert.assertFalse("Wrong equal to different class.", key1.equals(mk));
-        ExperimenterIdTypeDeserializerKey key2 =
-                new ExperimenterIdTypeDeserializerKey(EncodeConstants.OF10_VERSION_ID, 42L, 1L, ExperimenterMessage.class);
+        ExperimenterIdTypeDeserializerKey key2 = new ExperimenterIdTypeDeserializerKey(EncodeConstants.OF10_VERSION_ID,
+                42L, 1L, ExperimenterMessage.class);
         Assert.assertFalse("Wrong equal by experimenterId.", key1.equals(key2));
 
-        ExperimenterIdTypeDeserializerKey key3 =
-                new ExperimenterIdTypeDeserializerKey(EncodeConstants.OF10_VERSION_ID, 41L, 2L, ExperimenterMessage.class);
+        ExperimenterIdTypeDeserializerKey key3 = new ExperimenterIdTypeDeserializerKey(EncodeConstants.OF10_VERSION_ID,
+                41L, 2L, ExperimenterMessage.class);
         Assert.assertFalse("Wrong equal by type.", key1.equals(key3));
     }
 
-}
\ No newline at end of file
+}
index a613d0d85421a5e025e5319bab47181306bf642a..43bbddb26c1ec1733f58f0a150bdb0e776f26025 100644 (file)
@@ -17,25 +17,30 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterMessage;
 
 /**
+ * Unit tests for ExperimenterIdTypeSerializerKey.
+ *
  * @author michal.polkorab
  */
 public class ExperimenterIdTypeSerializerKeyTest {
 
     /**
-     * Test ExperimenterIdTypeSerializerKey equals and hashCode
+     * Test ExperimenterIdTypeSerializerKey equals and hashCode.
      */
     @Test
     public void testHashCodeAndEquals() {
         ExperimenterIdTypeSerializerKey<?> key1 =
-                new ExperimenterIdTypeSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 42L, 1L, ExperimenterMessage.class);
-        ExperimenterIdTypeSerializerKey<?> key2 =
-                new ExperimenterIdTypeSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 42L, 1L, ExperimenterMessage.class);
+                new ExperimenterIdTypeSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 42L, 1L,
+                        ExperimenterMessage.class);
+        ExperimenterIdTypeSerializerKey<?> key2 = new ExperimenterIdTypeSerializerKey<>(EncodeConstants.OF10_VERSION_ID,
+                42L, 1L, ExperimenterMessage.class);
         Assert.assertTrue("Wrong equals", key1.equals(key2));
         Assert.assertTrue("Wrong hashcode", key1.hashCode() == key2.hashCode());
-        key2 = new ExperimenterIdTypeSerializerKey<>(EncodeConstants.OF13_VERSION_ID, 42L, 1L, ExperimenterMessage.class);
+        key2 = new ExperimenterIdTypeSerializerKey<>(EncodeConstants.OF13_VERSION_ID, 42L, 1L,
+                ExperimenterMessage.class);
         Assert.assertFalse("Wrong equals", key1.equals(key2));
         Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
-        key2 = new ExperimenterIdTypeSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 55L, 1L, ExperimenterMessage.class);
+        key2 = new ExperimenterIdTypeSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 55L, 1L,
+                ExperimenterMessage.class);
         Assert.assertFalse("Wrong equals", key1.equals(key2));
         Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
         key2 = new ExperimenterIdTypeSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 55L, 1L, null);
@@ -45,28 +50,29 @@ public class ExperimenterIdTypeSerializerKeyTest {
         Assert.assertFalse("Wrong equals", key1.equals(key2));
         Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
 
-        key2 = new ExperimenterIdTypeSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 42L, 2L, ExperimenterMessage.class);
+        key2 = new ExperimenterIdTypeSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 42L, 2L,
+                ExperimenterMessage.class);
         Assert.assertFalse("Wrong equals", key1.equals(key2));
         Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
     }
 
     /**
-     * Test ExperimenterIdTypeSerializerKey equals - additional test
+     * Test ExperimenterIdTypeSerializerKey equals - additional test.
      */
     @Test
     public void testEquals() {
-        ExperimenterIdTypeSerializerKey<?> key1 =
-                new ExperimenterIdTypeSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 41L, 1L, ExperimenterMessage.class);
+        ExperimenterIdTypeSerializerKey<?> key1 = new ExperimenterIdTypeSerializerKey<>(EncodeConstants.OF10_VERSION_ID,
+                41L, 1L, ExperimenterMessage.class);
         Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1));
-        ExperimenterIdSerializerKey<?> mk = new ExperimenterIdSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 42L, ExperimenterMessage.class);
+        ExperimenterIdSerializerKey<?> mk = new ExperimenterIdSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 42L,
+                ExperimenterMessage.class);
         Assert.assertFalse("Wrong equal to different class.", key1.equals(mk));
-        ExperimenterIdTypeSerializerKey<?> key2 =
-                new ExperimenterIdTypeSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 42L, 1L, ExperimenterMessage.class);
+        ExperimenterIdTypeSerializerKey<?> key2 = new ExperimenterIdTypeSerializerKey<>(EncodeConstants.OF10_VERSION_ID,
+                42L, 1L, ExperimenterMessage.class);
         Assert.assertFalse("Wrong equal by experimenterId.", key1.equals(key2));
 
-        ExperimenterIdTypeSerializerKey<?> key3 =
-                new ExperimenterIdTypeSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 41L, 2L, ExperimenterMessage.class);
+        ExperimenterIdTypeSerializerKey<?> key3 = new ExperimenterIdTypeSerializerKey<>(EncodeConstants.OF10_VERSION_ID,
+                41L, 2L, ExperimenterMessage.class);
         Assert.assertFalse("Wrong equal by type.", key1.equals(key3));
     }
-
-}
\ No newline at end of file
+}
index 74f1bf96d90924eb5e3b902a3cdcdee08c548d9e..090a37eca1835479b645c208810d1c09bd718d16 100644 (file)
@@ -14,13 +14,14 @@ import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterInstructionDe
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 
 /**
- * @author michal.polkorab
+ * Unit tests for ExperimenterInstructionDeserializerKey.
  *
+ * @author michal.polkorab
  */
 public class ExperimenterInstructionDeserializerKeyTest {
 
     /**
-     * Test ExperimenterInstructionDeserializerKey equals and hashCode
+     * Test ExperimenterInstructionDeserializerKey equals and hashCode.
      */
     @Test
     public void test() {
@@ -40,4 +41,4 @@ public class ExperimenterInstructionDeserializerKeyTest {
         Assert.assertFalse("Wrong equals", key1.equals(key2));
         Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
     }
-}
\ No newline at end of file
+}
index e7f8e35a3d7c6e4e6f307acc8312ce1a063e5d56..83bad8daec99dde7d9d5441483b7601480fc435f 100644 (file)
@@ -14,13 +14,14 @@ import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterInstructionSe
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 
 /**
- * @author michal.polkorab
+ * Unit tests for ExperimenterInstructionSerializerKey.
  *
+ * @author michal.polkorab
  */
 public class ExperimenterInstructionSerializerKeyTest {
 
     /**
-     * Test ExperimenterInstructionSerializerKey equals and hashCode
+     * Test ExperimenterInstructionSerializerKey equals and hashCode.
      */
     @Test
     public void test() {
@@ -41,4 +42,4 @@ public class ExperimenterInstructionSerializerKeyTest {
         Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
 
     }
-}
\ No newline at end of file
+}
index 3c2bc650c7d22a83679578cee6f9a62bc0ca9382..08043df7b6a72e00ea5fb5b3c1bd152b0eb96b02 100644 (file)
@@ -12,52 +12,40 @@ import org.junit.Assert;
 import org.junit.Test;
 
 /**
+ * Unit tests for BinContent.
+ *
  * @author michal.polkorab
  */
 public class BinContentTest {
 
     /**
-     * Testing correct conversion from signed int value to unsigned long value
+     * Testing correct conversion from signed int value to unsigned long value.
      */
     @Test
     public void testIntToUnsignedLong() {
-        int a = 0;
-        int b = 1;
-        int c = -1;
-        int d = Integer.MAX_VALUE;
-        int e = Integer.MIN_VALUE;
-        int f = 12345;
-        Assert.assertEquals("Wrong conversion", 0, BinContent.intToUnsignedLong(a));
-        Assert.assertEquals("Wrong conversion", 1, BinContent.intToUnsignedLong(b));
-        Assert.assertEquals("Wrong conversion", 4294967295L, BinContent.intToUnsignedLong(c));
-        Assert.assertEquals("Wrong conversion", Integer.MAX_VALUE, BinContent.intToUnsignedLong(d));
-        Assert.assertEquals("Wrong conversion", ((long) Integer.MAX_VALUE) + 1, BinContent.intToUnsignedLong(e));
-        Assert.assertEquals("Wrong conversion", 12345, BinContent.intToUnsignedLong(f));
+        Assert.assertEquals("Wrong conversion", 0, BinContent.intToUnsignedLong(0));
+        Assert.assertEquals("Wrong conversion", 1, BinContent.intToUnsignedLong(1));
+        Assert.assertEquals("Wrong conversion", 4294967295L, BinContent.intToUnsignedLong(-1));
+        Assert.assertEquals("Wrong conversion", Integer.MAX_VALUE, BinContent.intToUnsignedLong(Integer.MAX_VALUE));
+        Assert.assertEquals("Wrong conversion", (long) Integer.MAX_VALUE + 1,
+                BinContent.intToUnsignedLong(Integer.MIN_VALUE));
+        Assert.assertEquals("Wrong conversion", 12345, BinContent.intToUnsignedLong(12345));
     }
 
     /**
-     * Testing correct conversion from unsigned long value to signed int value
+     * Testing correct conversion from unsigned long value to signed int value.
      */
     @Test
     public void testLongToSignedInt() {
-        long a = 0;
-        long b = 1;
-        long c = -1;
-        long d = Integer.MAX_VALUE;
-        long e = Integer.MIN_VALUE;
-        long f = 12345;
-        long g = Long.MAX_VALUE;
-        long h = 1094624935644L;
-        long i = ((long) Integer.MAX_VALUE) + 1;
-        Assert.assertEquals("Wrong conversion", 0, BinContent.longToSignedInt(a));
-        Assert.assertEquals("Wrong conversion", 1, BinContent.longToSignedInt(b));
-        Assert.assertEquals("Wrong conversion", -1, BinContent.longToSignedInt(c));
-        Assert.assertEquals("Wrong conversion", Integer.MAX_VALUE, BinContent.longToSignedInt(d));
-        Assert.assertEquals("Wrong conversion", Integer.MIN_VALUE, BinContent.longToSignedInt(e));
-        Assert.assertEquals("Wrong conversion", 12345, BinContent.longToSignedInt(f));
-        Assert.assertEquals("Wrong conversion", -1, BinContent.longToSignedInt(g));
-        Assert.assertEquals("Wrong conversion", -591724836, BinContent.longToSignedInt(h));
-        Assert.assertEquals("Wrong conversion", Integer.MIN_VALUE, BinContent.longToSignedInt(i));
+        Assert.assertEquals("Wrong conversion", 0, BinContent.longToSignedInt(0L));
+        Assert.assertEquals("Wrong conversion", 1, BinContent.longToSignedInt(1L));
+        Assert.assertEquals("Wrong conversion", -1, BinContent.longToSignedInt(-1L));
+        Assert.assertEquals("Wrong conversion", Integer.MAX_VALUE, BinContent.longToSignedInt(Integer.MAX_VALUE));
+        Assert.assertEquals("Wrong conversion", Integer.MIN_VALUE, BinContent.longToSignedInt(Integer.MIN_VALUE));
+        Assert.assertEquals("Wrong conversion", 12345, BinContent.longToSignedInt(12345L));
+        Assert.assertEquals("Wrong conversion", -1, BinContent.longToSignedInt(Long.MAX_VALUE));
+        Assert.assertEquals("Wrong conversion", -591724836, BinContent.longToSignedInt(1094624935644L));
+        Assert.assertEquals("Wrong conversion", Integer.MIN_VALUE, BinContent.longToSignedInt(Integer.MAX_VALUE + 1L));
     }
 
 }