blob: 26932f48652199ccb12845078f6c82585b0bafb0 [file] [log] [blame]
Vinod Kumar S17711e52016-02-09 20:02:43 +05301/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
Vinod Kumar S17711e52016-02-09 20:02:43 +05303 *
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.yangutils.datamodel;
17
18import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
19import org.onosproject.yangutils.parser.Parsable;
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +053020import org.onosproject.yangutils.utils.YangConstructType;
Vinod Kumar S17711e52016-02-09 20:02:43 +053021
22/*
23 * Reference:RFC 6020.
24 * The "revision" statement specifies the editorial revision history of
25 * the module, including the initial revision. A series of revision
26 * statements detail the changes in the module's definition. The
27 * argument is a date string in the format "YYYY-MM-DD", followed by a
28 * block of sub-statements that holds detailed revision information. A
29 * module SHOULD have at least one initial "revision" statement. For
30 * every published editorial change, a new one SHOULD be added in front
31 * of the revisions sequence, so that all revisions are in reverse
32 * chronological order.
33 * The revision's sub-statement
34 *
35 * +--------------+---------+-------------+------------------+
36 * | substatement | section | cardinality |data model mapping|
37 * +--------------+---------+-------------+------------------+
38 * | description | 7.19.3 | 0..1 |string |
39 * | reference | 7.19.4 | 0..1 |sring |
40 * +--------------+---------+-------------+------------------+
41 */
42/**
Bharat saraswald9822e92016-04-05 15:13:44 +053043 * Represents the information about the revision.
Vinod Kumar S17711e52016-02-09 20:02:43 +053044 */
45public class YangRevision implements YangDesc, YangReference, Parsable {
46
47 /**
48 * Revision date. Date string in the format "YYYY-MM-DD"
49 */
50 private String revDate;
51
52 /**
53 * Description of revision.
54 */
55 private String description;
56
57 /**
58 * Textual reference for revision.
59 */
60 private String reference;
61
62 /**
Bharat saraswald9822e92016-04-05 15:13:44 +053063 * Creates a YANG revision object.
Vinod Kumar S17711e52016-02-09 20:02:43 +053064 */
65 public YangRevision() {
66 }
67
68 /**
Bharat saraswald9822e92016-04-05 15:13:44 +053069 * Returns the revision date.
Vinod Kumar S17711e52016-02-09 20:02:43 +053070 *
71 * @return the revision date
72 */
73 public String getRevDate() {
74 return revDate;
75 }
76
77 /**
Bharat saraswald9822e92016-04-05 15:13:44 +053078 * Sets the revision date.
Vinod Kumar S17711e52016-02-09 20:02:43 +053079 *
80 * @param revDate the revision date to set
81 */
82 public void setRevDate(String revDate) {
83 this.revDate = revDate;
84 }
85
86 /**
Bharat saraswald9822e92016-04-05 15:13:44 +053087 * Returns the description.
Vinod Kumar S17711e52016-02-09 20:02:43 +053088 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +053089 * @return the description
Vinod Kumar S17711e52016-02-09 20:02:43 +053090 */
Vinod Kumar S0c330cd2016-02-23 22:36:57 +053091 @Override
Vinod Kumar S17711e52016-02-09 20:02:43 +053092 public String getDescription() {
93 return description;
94 }
95
96 /**
Bharat saraswald9822e92016-04-05 15:13:44 +053097 * Sets the description.
Vinod Kumar S17711e52016-02-09 20:02:43 +053098 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +053099 * @param description set the description
Vinod Kumar S17711e52016-02-09 20:02:43 +0530100 */
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530101 @Override
Vinod Kumar S17711e52016-02-09 20:02:43 +0530102 public void setDescription(String description) {
103 this.description = description;
104 }
105
106 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530107 * Returns the textual reference.
Vinod Kumar S17711e52016-02-09 20:02:43 +0530108 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530109 * @return the reference
Vinod Kumar S17711e52016-02-09 20:02:43 +0530110 */
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530111 @Override
Vinod Kumar S17711e52016-02-09 20:02:43 +0530112 public String getReference() {
113 return reference;
114 }
115
116 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530117 * Sets the textual reference.
Vinod Kumar S17711e52016-02-09 20:02:43 +0530118 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530119 * @param reference the reference to set
Vinod Kumar S17711e52016-02-09 20:02:43 +0530120 */
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530121 @Override
Vinod Kumar S17711e52016-02-09 20:02:43 +0530122 public void setReference(String reference) {
123 this.reference = reference;
124 }
125
126 /**
127 * Returns the type of the parsed data.
128 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530129 * @return returns REVISION_DATA
Vinod Kumar S17711e52016-02-09 20:02:43 +0530130 */
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530131 @Override
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530132 public YangConstructType getYangConstructType() {
133 return YangConstructType.REVISION_DATA;
Vinod Kumar S17711e52016-02-09 20:02:43 +0530134 }
135
136 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530137 * Validates the data on entering the corresponding parse tree node.
Vinod Kumar S17711e52016-02-09 20:02:43 +0530138 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530139 * @throws DataModelException a violation of data model rules
Vinod Kumar S17711e52016-02-09 20:02:43 +0530140 */
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530141 @Override
Vinod Kumar S17711e52016-02-09 20:02:43 +0530142 public void validateDataOnEntry() throws DataModelException {
143 // TODO auto-generated method stub, to be implemented by parser
144
145 }
146
147 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530148 * Validates the data on exiting the corresponding parse tree node.
Vinod Kumar S17711e52016-02-09 20:02:43 +0530149 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530150 * @throws DataModelException a violation of data model rules
Vinod Kumar S17711e52016-02-09 20:02:43 +0530151 */
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530152 @Override
Vinod Kumar S17711e52016-02-09 20:02:43 +0530153 public void validateDataOnExit() throws DataModelException {
154 // TODO auto-generated method stub, to be implemented by parser
155
156 }
157}