Madan Jampani | e4ff21b | 2014-10-02 15:17:32 -0700 | [diff] [blame] | 1 | package org.onlab.onos.store.messaging.impl; |
2 | |||||
3 | /** | ||||
4 | * Interface for encoding/decoding message payloads. | ||||
5 | */ | ||||
6 | public interface Serializer { | ||||
7 | |||||
8 | /** | ||||
9 | * Decodes the specified byte array to a POJO. | ||||
10 | * | ||||
11 | * @param data byte array. | ||||
12 | * @return POJO | ||||
13 | */ | ||||
14 | Object decode(byte[] data); | ||||
15 | |||||
16 | /** | ||||
17 | * Encodes the specified POJO into a byte array. | ||||
18 | * | ||||
19 | * @param data POJO to be encoded | ||||
20 | * @return byte array. | ||||
21 | */ | ||||
22 | byte[] encode(Object message); | ||||
23 | |||||
24 | } |