Madan Jampani
Committed by Gerrit Code Review

Added a utility method for creating store Serializer from a single KryoNamespace…

… and some additional classes

Change-Id: I1326759bf83a2e4f943ea52df8ebd7e9356c3a93
...@@ -53,6 +53,24 @@ public interface Serializer { ...@@ -53,6 +53,24 @@ public interface Serializer {
53 return using(Arrays.asList(kryo)); 53 return using(Arrays.asList(kryo));
54 } 54 }
55 55
56 + /**
57 + * Creates a new Serializer instance from a KryoNamespace and some additional classes.
58 + *
59 + * @param namespace kryo namespace
60 + * @param classes variable length array of classes to register
61 + * @return Serializer instance
62 + */
63 + static Serializer using(KryoNamespace namespace, Class<?>... classes) {
64 + return using(Arrays.asList(namespace), classes);
65 + }
66 +
67 + /**
68 + * Creates a new Serializer instance from a list of KryoNamespaces and some additional classes.
69 + *
70 + * @param namespaces kryo namespaces
71 + * @param classes variable length array of classes to register
72 + * @return Serializer instance
73 + */
56 static Serializer using(List<KryoNamespace> namespaces, Class<?>... classes) { 74 static Serializer using(List<KryoNamespace> namespaces, Class<?>... classes) {
57 KryoNamespace.Builder builder = new KryoNamespace.Builder(); 75 KryoNamespace.Builder builder = new KryoNamespace.Builder();
58 namespaces.forEach(builder::register); 76 namespaces.forEach(builder::register);
......
...@@ -45,8 +45,8 @@ public class ExtendedSet<E> implements Set<E> { ...@@ -45,8 +45,8 @@ public class ExtendedSet<E> implements Set<E> {
45 45
46 /** 46 /**
47 * Returns set element that is equal to the specified object. 47 * Returns set element that is equal to the specified object.
48 - * @param o 48 + * @param o object
49 - * @return 49 + * @return set element that is equal to the input argument or null if no such set element exists
50 */ 50 */
51 public E get(Object o) { 51 public E get(Object o) {
52 return map.get(o); 52 return map.get(o);
......