Added a utility method for creating store Serializer from a single KryoNamespace and some additional classes
Change-Id: I1326759bf83a2e4f943ea52df8ebd7e9356c3a93
diff --git a/core/api/src/main/java/org/onosproject/store/service/Serializer.java b/core/api/src/main/java/org/onosproject/store/service/Serializer.java
index 6245175..cac14cb 100644
--- a/core/api/src/main/java/org/onosproject/store/service/Serializer.java
+++ b/core/api/src/main/java/org/onosproject/store/service/Serializer.java
@@ -53,6 +53,24 @@
return using(Arrays.asList(kryo));
}
+ /**
+ * Creates a new Serializer instance from a KryoNamespace and some additional classes.
+ *
+ * @param namespace kryo namespace
+ * @param classes variable length array of classes to register
+ * @return Serializer instance
+ */
+ static Serializer using(KryoNamespace namespace, Class<?>... classes) {
+ return using(Arrays.asList(namespace), classes);
+ }
+
+ /**
+ * Creates a new Serializer instance from a list of KryoNamespaces and some additional classes.
+ *
+ * @param namespaces kryo namespaces
+ * @param classes variable length array of classes to register
+ * @return Serializer instance
+ */
static Serializer using(List<KryoNamespace> namespaces, Class<?>... classes) {
KryoNamespace.Builder builder = new KryoNamespace.Builder();
namespaces.forEach(builder::register);
diff --git a/utils/misc/src/main/java/org/onlab/util/ExtendedSet.java b/utils/misc/src/main/java/org/onlab/util/ExtendedSet.java
index 0ee1278..3dde285 100644
--- a/utils/misc/src/main/java/org/onlab/util/ExtendedSet.java
+++ b/utils/misc/src/main/java/org/onlab/util/ExtendedSet.java
@@ -45,8 +45,8 @@
/**
* Returns set element that is equal to the specified object.
- * @param o
- * @return
+ * @param o object
+ * @return set element that is equal to the input argument or null if no such set element exists
*/
public E get(Object o) {
return map.get(o);