Gaurav Agrawal | b538e06 | 2017-02-07 15:00:35 +0530 | [diff] [blame] | 1 | /* |
| 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 Agrawal | 4efc8cc | 2017-02-09 18:41:31 +0530 | [diff] [blame^] | 17 | package org.onosproject.yang.runtime; |
Gaurav Agrawal | b538e06 | 2017-02-07 15:00:35 +0530 | [diff] [blame] | 18 | |
| 19 | import org.onosproject.yang.model.DataNode; |
| 20 | import org.onosproject.yang.model.ResourceId; |
| 21 | |
| 22 | import java.util.List; |
| 23 | |
| 24 | /** |
| 25 | * Abstraction of an entity that is representation of resource data. |
| 26 | */ |
| 27 | public 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 Agrawal | 4efc8cc | 2017-02-09 18:41:31 +0530 | [diff] [blame^] | 65 | * Builds an instance of resource data. |
Gaurav Agrawal | b538e06 | 2017-02-07 15:00:35 +0530 | [diff] [blame] | 66 | * |
Gaurav Agrawal | 4efc8cc | 2017-02-09 18:41:31 +0530 | [diff] [blame^] | 67 | * @return resource data |
Gaurav Agrawal | b538e06 | 2017-02-07 15:00:35 +0530 | [diff] [blame] | 68 | */ |
Gaurav Agrawal | 4efc8cc | 2017-02-09 18:41:31 +0530 | [diff] [blame^] | 69 | ResourceData build(); |
Gaurav Agrawal | b538e06 | 2017-02-07 15:00:35 +0530 | [diff] [blame] | 70 | } |
| 71 | } |