separate basic classes from API
Change-Id: I110ebc7da395f60d8c95d8bb09c00bcc2a4f0547
Showing
1 changed file
with
15 additions
and
12 deletions
... | @@ -103,6 +103,20 @@ import com.google.common.collect.ImmutableSet; | ... | @@ -103,6 +103,20 @@ import com.google.common.collect.ImmutableSet; |
103 | 103 | ||
104 | public final class KryoNamespaces { | 104 | public final class KryoNamespaces { |
105 | 105 | ||
106 | + public static final KryoNamespace BASIC = KryoNamespace.newBuilder() | ||
107 | + .register(ImmutableMap.class, new ImmutableMapSerializer()) | ||
108 | + .register(ImmutableList.class, new ImmutableListSerializer()) | ||
109 | + .register(ImmutableSet.class, new ImmutableSetSerializer()) | ||
110 | + .register( | ||
111 | + ArrayList.class, | ||
112 | + Arrays.asList().getClass(), | ||
113 | + HashMap.class, | ||
114 | + HashSet.class, | ||
115 | + LinkedList.class, | ||
116 | + byte[].class | ||
117 | + ) | ||
118 | + .build(); | ||
119 | + | ||
106 | /** | 120 | /** |
107 | * KryoNamespace which can serialize ON.lab misc classes. | 121 | * KryoNamespace which can serialize ON.lab misc classes. |
108 | */ | 122 | */ |
... | @@ -123,19 +137,8 @@ public final class KryoNamespaces { | ... | @@ -123,19 +137,8 @@ public final class KryoNamespaces { |
123 | */ | 137 | */ |
124 | public static final KryoNamespace API = KryoNamespace.newBuilder() | 138 | public static final KryoNamespace API = KryoNamespace.newBuilder() |
125 | .register(MISC) | 139 | .register(MISC) |
126 | - .register(ImmutableMap.class, new ImmutableMapSerializer()) | 140 | + .register(BASIC) |
127 | - .register(ImmutableList.class, new ImmutableListSerializer()) | ||
128 | - .register(ImmutableSet.class, new ImmutableSetSerializer()) | ||
129 | .register( | 141 | .register( |
130 | - // | ||
131 | - ArrayList.class, | ||
132 | - Arrays.asList().getClass(), | ||
133 | - HashMap.class, | ||
134 | - HashSet.class, | ||
135 | - LinkedList.class, | ||
136 | - byte[].class, | ||
137 | - // | ||
138 | - // | ||
139 | ControllerNode.State.class, | 142 | ControllerNode.State.class, |
140 | Device.Type.class, | 143 | Device.Type.class, |
141 | Port.Type.class, | 144 | Port.Type.class, | ... | ... |
-
Please register or login to post a comment