blob: b4af900081e835c91c33bfb35a1f7ec321425236 [file] [log] [blame]
Gaurav Agrawalb538e062017-02-07 15:00:35 +05301/*
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 */
16
Gaurav Agrawal4efc8cc2017-02-09 18:41:31 +053017package org.onosproject.yang.runtime;
Gaurav Agrawalb538e062017-02-07 15:00:35 +053018
19import org.onosproject.yang.model.DataNode;
20import org.onosproject.yang.model.ResourceId;
21
22import java.util.List;
23
24/**
25 * Abstraction of an entity that is representation of resource data.
26 */
27public interface ResourceData {
28
29 /**
30 * Returns list of data nodes.
31 *
32 * @return list of data nodes
33 */
34 List<DataNode> dataNodes();
35
36 /**
37 * Returns resource identifier.
38 *
39 * @return resource identifier
40 */
41 ResourceId resourceId();
42
43 /**
44 * Abstraction of an entity that represents builder of composite data.
45 */
46 interface Builder {
47
48 /**
49 * Adds a data node.
50 *
51 * @param node data node
52 * @return builder
53 */
54 Builder addDataNode(DataNode node);
55
56 /**
57 * Sets resource identifier.
58 *
59 * @param identifier resource identifier
60 * @return builder
61 */
62 Builder resourceId(ResourceId identifier);
63
64 /**
Gaurav Agrawal4efc8cc2017-02-09 18:41:31 +053065 * Builds an instance of resource data.
Gaurav Agrawalb538e062017-02-07 15:00:35 +053066 *
Gaurav Agrawal4efc8cc2017-02-09 18:41:31 +053067 * @return resource data
Gaurav Agrawalb538e062017-02-07 15:00:35 +053068 */
Gaurav Agrawal4efc8cc2017-02-09 18:41:31 +053069 ResourceData build();
Gaurav Agrawalb538e062017-02-07 15:00:35 +053070 }
71}