mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-17 10:21:52 +02:00
Added a utility method for creating store Serializer from a single KryoNamespace and some additional classes
Change-Id: I1326759bf83a2e4f943ea52df8ebd7e9356c3a93
This commit is contained in:
parent
6f4ae1c8d3
commit
17ed48b5d1
@ -53,6 +53,24 @@ public interface Serializer {
|
||||
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);
|
||||
|
@ -45,8 +45,8 @@ public class ExtendedSet<E> implements Set<E> {
|
||||
|
||||
/**
|
||||
* 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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user