Binary incompatible serializer changes

- If the field type is fixed and the type is final, Class info can be omitted
- Annotations serializer to use optimization based on the fact Map<String, String> and non-null key/value
- Reduce number of Map copy required for ImmutableMap serializer
- Reduce number of array copy behind Immutable{List, Set} serializer

Change-Id: Ie467a943a33fbfb43b289b8b71ad91ee5890bfb0
diff --git a/core/store/dist/src/main/java/org/onosproject/store/device/impl/InternalDeviceEventSerializer.java b/core/store/dist/src/main/java/org/onosproject/store/device/impl/InternalDeviceEventSerializer.java
index 5aca94c..253cc83 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/device/impl/InternalDeviceEventSerializer.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/device/impl/InternalDeviceEventSerializer.java
@@ -15,11 +15,12 @@
  */
 package org.onosproject.store.device.impl;
 
+import static org.onosproject.store.serializers.DeviceIdSerializer.deviceIdSerializer;
+
 import org.onosproject.net.DeviceId;
 import org.onosproject.net.device.DeviceDescription;
 import org.onosproject.net.provider.ProviderId;
 import org.onosproject.store.impl.Timestamped;
-
 import com.esotericsoftware.kryo.Kryo;
 import com.esotericsoftware.kryo.Serializer;
 import com.esotericsoftware.kryo.io.Input;
@@ -41,7 +42,7 @@
     @Override
     public void write(Kryo kryo, Output output, InternalDeviceEvent event) {
         kryo.writeClassAndObject(output, event.providerId());
-        kryo.writeClassAndObject(output, event.deviceId());
+        kryo.writeObject(output, event.deviceId(), deviceIdSerializer());
         kryo.writeClassAndObject(output, event.deviceDescription());
     }
 
@@ -49,7 +50,7 @@
     public InternalDeviceEvent read(Kryo kryo, Input input,
                                Class<InternalDeviceEvent> type) {
         ProviderId providerId = (ProviderId) kryo.readClassAndObject(input);
-        DeviceId deviceId = (DeviceId) kryo.readClassAndObject(input);
+        DeviceId deviceId = kryo.readObject(input, DeviceId.class, deviceIdSerializer());
 
         @SuppressWarnings("unchecked")
         Timestamped<DeviceDescription> deviceDescription