Committed by
Gerrit Code Review
DeviceIdSerializer: use case normalized String
Change-Id: I6995e224ed5567e3d2d65dac3891252dd8c4dd7b
Showing
1 changed file
with
3 additions
and
5 deletions
... | @@ -15,8 +15,6 @@ | ... | @@ -15,8 +15,6 @@ |
15 | */ | 15 | */ |
16 | package org.onosproject.store.serializers; | 16 | package org.onosproject.store.serializers; |
17 | 17 | ||
18 | -import java.net.URI; | ||
19 | - | ||
20 | import org.onosproject.net.DeviceId; | 18 | import org.onosproject.net.DeviceId; |
21 | 19 | ||
22 | import com.esotericsoftware.kryo.Kryo; | 20 | import com.esotericsoftware.kryo.Kryo; |
... | @@ -39,12 +37,12 @@ public final class DeviceIdSerializer extends Serializer<DeviceId> { | ... | @@ -39,12 +37,12 @@ public final class DeviceIdSerializer extends Serializer<DeviceId> { |
39 | 37 | ||
40 | @Override | 38 | @Override |
41 | public void write(Kryo kryo, Output output, DeviceId object) { | 39 | public void write(Kryo kryo, Output output, DeviceId object) { |
42 | - kryo.writeObject(output, object.uri()); | 40 | + output.writeString(object.toString()); |
43 | } | 41 | } |
44 | 42 | ||
45 | @Override | 43 | @Override |
46 | public DeviceId read(Kryo kryo, Input input, Class<DeviceId> type) { | 44 | public DeviceId read(Kryo kryo, Input input, Class<DeviceId> type) { |
47 | - final URI uri = kryo.readObject(input, URI.class); | 45 | + final String str = input.readString(); |
48 | - return DeviceId.deviceId(uri); | 46 | + return DeviceId.deviceId(str); |
49 | } | 47 | } |
50 | } | 48 | } | ... | ... |
-
Please register or login to post a comment