blob: ac55f5af7a0cb13c669f2813cbcc06a41588135b [file] [log] [blame]
Madan Jampaniab6d3112014-10-02 16:30:14 -07001package org.onlab.netty;
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}