blob: b03c5a89ac5446c13ab68ffb0fb9f8c71cf608fc [file] [log] [blame]
Jian Li246334b2017-03-31 00:37:01 +09001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2017-present Open Networking Foundation
Jian Li246334b2017-03-31 00:37:01 +09003 *
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 */
16package org.onosproject.mapping.addresses;
17
18import com.fasterxml.jackson.databind.node.ObjectNode;
19import org.onosproject.codec.CodecContext;
20import org.onosproject.net.driver.HandlerBehaviour;
21
22/**
23 * Interface for encode and decode extension mapping address.
24 */
25public interface ExtensionMappingAddressCodec extends HandlerBehaviour {
26
27 /**
28 * Encodes an extension mapping address to an JSON object.
29 *
30 * @param extensionMappingAddress extension mapping address
31 * @param context encoding context
32 * @return JSON object
33 */
34 default ObjectNode encode(ExtensionMappingAddress extensionMappingAddress,
35 CodecContext context) {
36 return null;
37 }
38
39 /**
40 * Decodes a JSON object to an extension mapping address.
41 *
42 * @param objectNode JSON object
43 * @param context decoding context
44 * @return extension mapping address
45 */
46 default ExtensionMappingAddress decode(ObjectNode objectNode, CodecContext context) {
47 return null;
48 }
49}