blob: d2da7cf2925ab0b209ee3a70b55341f660ce233a [file] [log] [blame]
Madan Jampanie4ff21b2014-10-02 15:17:32 -07001package org.onlab.onos.store.messaging.impl;
2
3/**
4 * Interface for encoding/decoding message payloads.
5 */
6public 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}