blob: 231e17d0db30fa48ce1b0ccfce7392198b5ab217 [file] [log] [blame]
Andrea Campanella2cfe8ef2017-07-13 19:45:15 +02001/*
2 * Copyright 2017-present 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 */
16package org.onosproject.net.flow;
17
18import com.fasterxml.jackson.databind.node.ObjectNode;
19import org.onosproject.codec.CodecContext;
20import org.onosproject.net.driver.HandlerBehaviour;
21import org.onosproject.net.flow.criteria.ExtensionSelector;
22
23/**
24 * Interface for encode and decode extension selector.
25 */
26public interface ExtensionSelectorCodec extends HandlerBehaviour {
27
28 /**
29 * Encodes an extension selector to an JSON object.
30 *
31 * @param extensionSelector extension selector
32 * @param context encoding context
33 * @return JSON object
34 */
35 default ObjectNode encode(ExtensionSelector extensionSelector, CodecContext context) {
36 return null;
37 }
38
39 /**
40 * Decodes an JSON object to an extension selector.
41 *
42 * @param objectNode JSON object
43 * @param context decoding context
44 * @return extension selector
45 */
46 default ExtensionSelector decode(ObjectNode objectNode, CodecContext context) {
47 return null;
48 }
49}