blob: 69581e1eb084e13e7c7b3e113ed2b66d6181c5f2 [file] [log] [blame]
Yuta HIGUCHIf148aac2014-05-05 14:59:06 -07001package net.onrc.onos.core.datastore.utils;
2
3/**
4 * Interface to serialize object into byte[].
5 *
6 * Serializer instance is expected to be functional even if the
7 * instance was shared among multiple threads.
8 */
9public interface Serializer {
10 /**
11 * Serializes a given object.
12 *
13 * @param obj the object to serialize
14 * @return binary representation of the serialized object
15 */
16 public byte[] serialize(final Object obj);
17
18 /**
19 * Deserializes a given byte array.
20 *
21 * @param bytes binary representation of an Object
22 * @return deserialized object
23 */
24 public <T> T deserialize(final byte[] bytes);
25}