blob: 466943e4decb9f7066c80b7c6fe520992fd1b2ca [file] [log] [blame]
Madan Jampani25461112015-02-17 14:17:29 -08001/*
2 * Copyright 2015 Open Networking Laboratory
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Madan Jampani393e0f02015-02-12 07:35:39 +053017package org.onosproject.store.service;
18
19/**
20 * Interface for serialization for store artifacts.
21 */
22public interface Serializer {
23 /**
24 * Serialize the specified object.
25 * @param object object to serialize.
26 * @return serialized bytes.
27 * @param <T> encoded type
28 */
29 <T> byte[] encode(T object);
30
31 /**
32 * Deserialize the specified bytes.
33 * @param bytes byte array to deserialize.
34 * @return deserialized object.
35 * @param <T> decoded type
36 */
37 <T> T decode(byte[] bytes);
38}