Vidyashree Rama | b624817 | 2016-05-17 16:16:15 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016-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 | |
| 17 | package org.onosproject.yangutils.plugin.manager; |
| 18 | |
Gaurav Agrawal | ab7c4bd | 2016-05-17 18:06:38 +0530 | [diff] [blame] | 19 | import java.util.Objects; |
VinodKumarS-Huawei | d81eccb | 2016-06-01 14:30:22 +0530 | [diff] [blame] | 20 | import org.onosproject.yangutils.linker.ResolvableStatus; |
Vidyashree Rama | b624817 | 2016-05-17 16:16:15 +0530 | [diff] [blame] | 21 | import org.onosproject.yangutils.datamodel.YangNode; |
| 22 | |
| 23 | /** |
| 24 | * Represents YANG file information. |
| 25 | */ |
| 26 | public class YangFileInfo { |
| 27 | |
| 28 | /** |
| 29 | * YANG file name. |
| 30 | */ |
| 31 | private String yangFileName; |
| 32 | |
| 33 | /** |
Gaurav Agrawal | ab7c4bd | 2016-05-17 18:06:38 +0530 | [diff] [blame] | 34 | * YANG file revision. |
| 35 | */ |
| 36 | private String revision; |
| 37 | |
| 38 | /** |
Vidyashree Rama | b624817 | 2016-05-17 16:16:15 +0530 | [diff] [blame] | 39 | * Data model node after parsing YANG file. |
| 40 | */ |
| 41 | private YangNode rootNode; |
| 42 | |
| 43 | /** |
Gaurav Agrawal | ab7c4bd | 2016-05-17 18:06:38 +0530 | [diff] [blame] | 44 | * Resolution status of YANG file. |
| 45 | */ |
| 46 | private ResolvableStatus resolvableStatus; |
| 47 | |
| 48 | /** |
Vidyashree Rama | b624817 | 2016-05-17 16:16:15 +0530 | [diff] [blame] | 49 | * Returns data model node for YANG file. |
| 50 | * |
| 51 | * @return data model node for YANG file |
| 52 | */ |
| 53 | public YangNode getRootNode() { |
| 54 | return rootNode; |
| 55 | } |
| 56 | |
| 57 | /** |
| 58 | * Sets data model node for YANG file. |
| 59 | * |
| 60 | * @param rootNode of the Yang file |
| 61 | */ |
| 62 | public void setRootNode(YangNode rootNode) { |
| 63 | this.rootNode = rootNode; |
| 64 | } |
| 65 | |
| 66 | /** |
| 67 | * Returns YANG file name. |
| 68 | * |
| 69 | * @return yangFileName YANG file name |
| 70 | */ |
| 71 | public String getYangFileName() { |
| 72 | return yangFileName; |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | * Sets YANG file name. |
| 77 | * |
| 78 | * @param yangFileName YANG file name |
| 79 | */ |
| 80 | public void setYangFileName(String yangFileName) { |
| 81 | this.yangFileName = yangFileName; |
| 82 | } |
Gaurav Agrawal | ab7c4bd | 2016-05-17 18:06:38 +0530 | [diff] [blame] | 83 | |
| 84 | /** |
| 85 | * Returns the revision of YANG file. |
| 86 | * |
| 87 | * @return revision of YANG file |
| 88 | */ |
| 89 | public String getRevision() { |
| 90 | return revision; |
| 91 | } |
| 92 | |
| 93 | /** |
| 94 | * Sets the revision of YANG file. |
| 95 | * |
| 96 | * @param revision revision of YANG file |
| 97 | */ |
| 98 | public void setRevision(String revision) { |
| 99 | this.revision = revision; |
| 100 | } |
| 101 | |
| 102 | /** |
| 103 | * Returns the resolution status of YANG file. |
| 104 | * |
| 105 | * @return resolution status of YANG file |
| 106 | */ |
| 107 | public ResolvableStatus getResolvableStatus() { |
| 108 | return resolvableStatus; |
| 109 | } |
| 110 | |
| 111 | /** |
| 112 | * Sets the resolution status of YANG file. |
| 113 | * |
| 114 | * @param resolvableStatus resolution status of YANG file |
| 115 | */ |
| 116 | public void setResolvableStatus(ResolvableStatus resolvableStatus) { |
| 117 | this.resolvableStatus = resolvableStatus; |
| 118 | } |
| 119 | |
| 120 | @Override |
| 121 | public boolean equals(Object obj) { |
| 122 | |
| 123 | if (this == obj) { |
| 124 | return true; |
| 125 | } |
| 126 | if (obj instanceof YangFileInfo) { |
| 127 | final YangFileInfo other = (YangFileInfo) obj; |
| 128 | return Objects.equals(this.yangFileName, other.yangFileName); |
| 129 | } |
| 130 | return false; |
| 131 | } |
| 132 | |
| 133 | @Override |
| 134 | public int hashCode() { |
| 135 | return Objects.hashCode(this.yangFileName); |
| 136 | } |
Vidyashree Rama | b624817 | 2016-05-17 16:16:15 +0530 | [diff] [blame] | 137 | } |