blob: aa326fd7501b4a62c4f0e59be51787cb2ac1440b [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
Bharat saraswal96dfef02016-06-16 00:29:12 +053018import java.io.Serializable;
19
Vinod Kumar S17711e52016-02-09 20:02:43 +053020import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
Bharat saraswal96dfef02016-06-16 00:29:12 +053021import org.onosproject.yangutils.datamodel.utils.Parsable;
22import org.onosproject.yangutils.datamodel.utils.YangConstructType;
Vinod Kumar S17711e52016-02-09 20:02:43 +053023
24/*
25 * Reference:RFC 6020.
26 * The "revision" statement specifies the editorial revision history of
27 * the module, including the initial revision. A series of revision
28 * statements detail the changes in the module's definition. The
29 * argument is a date string in the format "YYYY-MM-DD", followed by a
30 * block of sub-statements that holds detailed revision information. A
31 * module SHOULD have at least one initial "revision" statement. For
32 * every published editorial change, a new one SHOULD be added in front
33 * of the revisions sequence, so that all revisions are in reverse
34 * chronological order.
35 * The revision's sub-statement
36 *
37 * +--------------+---------+-------------+------------------+
38 * | substatement | section | cardinality |data model mapping|
39 * +--------------+---------+-------------+------------------+
40 * | description | 7.19.3 | 0..1 |string |
41 * | reference | 7.19.4 | 0..1 |sring |
42 * +--------------+---------+-------------+------------------+
43 */
44/**
Bharat saraswald9822e92016-04-05 15:13:44 +053045 * Represents the information about the revision.
Vinod Kumar S17711e52016-02-09 20:02:43 +053046 */
Bharat saraswal96dfef02016-06-16 00:29:12 +053047public class YangRevision implements YangDesc, YangReference, Parsable, Serializable {
48
49 private static final long serialVersionUID = 8062016052L;
Vinod Kumar S17711e52016-02-09 20:02:43 +053050
51 /**
52 * Revision date. Date string in the format "YYYY-MM-DD"
53 */
54 private String revDate;
55
56 /**
57 * Description of revision.
58 */
59 private String description;
60
61 /**
62 * Textual reference for revision.
63 */
64 private String reference;
65
66 /**
Bharat saraswald9822e92016-04-05 15:13:44 +053067 * Creates a YANG revision object.
Vinod Kumar S17711e52016-02-09 20:02:43 +053068 */
69 public YangRevision() {
70 }
71
72 /**
Bharat saraswald9822e92016-04-05 15:13:44 +053073 * Returns the revision date.
Vinod Kumar S17711e52016-02-09 20:02:43 +053074 *
75 * @return the revision date
76 */
77 public String getRevDate() {
78 return revDate;
79 }
80
81 /**
Bharat saraswald9822e92016-04-05 15:13:44 +053082 * Sets the revision date.
Vinod Kumar S17711e52016-02-09 20:02:43 +053083 *
84 * @param revDate the revision date to set
85 */
86 public void setRevDate(String revDate) {
87 this.revDate = revDate;
88 }
89
90 /**
Bharat saraswald9822e92016-04-05 15:13:44 +053091 * Returns the description.
Vinod Kumar S17711e52016-02-09 20:02:43 +053092 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +053093 * @return the description
Vinod Kumar S17711e52016-02-09 20:02:43 +053094 */
Vinod Kumar S0c330cd2016-02-23 22:36:57 +053095 @Override
Vinod Kumar S17711e52016-02-09 20:02:43 +053096 public String getDescription() {
97 return description;
98 }
99
100 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530101 * Sets the description.
Vinod Kumar S17711e52016-02-09 20:02:43 +0530102 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530103 * @param description set the description
Vinod Kumar S17711e52016-02-09 20:02:43 +0530104 */
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530105 @Override
Vinod Kumar S17711e52016-02-09 20:02:43 +0530106 public void setDescription(String description) {
107 this.description = description;
108 }
109
110 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530111 * Returns the textual reference.
Vinod Kumar S17711e52016-02-09 20:02:43 +0530112 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530113 * @return the reference
Vinod Kumar S17711e52016-02-09 20:02:43 +0530114 */
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530115 @Override
Vinod Kumar S17711e52016-02-09 20:02:43 +0530116 public String getReference() {
117 return reference;
118 }
119
120 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530121 * Sets the textual reference.
Vinod Kumar S17711e52016-02-09 20:02:43 +0530122 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530123 * @param reference the reference to set
Vinod Kumar S17711e52016-02-09 20:02:43 +0530124 */
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530125 @Override
Vinod Kumar S17711e52016-02-09 20:02:43 +0530126 public void setReference(String reference) {
127 this.reference = reference;
128 }
129
130 /**
131 * Returns the type of the parsed data.
132 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530133 * @return returns REVISION_DATA
Vinod Kumar S17711e52016-02-09 20:02:43 +0530134 */
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530135 @Override
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530136 public YangConstructType getYangConstructType() {
137 return YangConstructType.REVISION_DATA;
Vinod Kumar S17711e52016-02-09 20:02:43 +0530138 }
139
140 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530141 * Validates the data on entering the corresponding parse tree node.
Vinod Kumar S17711e52016-02-09 20:02:43 +0530142 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530143 * @throws DataModelException a violation of data model rules
Vinod Kumar S17711e52016-02-09 20:02:43 +0530144 */
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530145 @Override
Vinod Kumar S17711e52016-02-09 20:02:43 +0530146 public void validateDataOnEntry() throws DataModelException {
147 // TODO auto-generated method stub, to be implemented by parser
148
149 }
150
151 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530152 * Validates the data on exiting the corresponding parse tree node.
Vinod Kumar S17711e52016-02-09 20:02:43 +0530153 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +0530154 * @throws DataModelException a violation of data model rules
Vinod Kumar S17711e52016-02-09 20:02:43 +0530155 */
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530156 @Override
Vinod Kumar S17711e52016-02-09 20:02:43 +0530157 public void validateDataOnExit() throws DataModelException {
158 // TODO auto-generated method stub, to be implemented by parser
159
160 }
161}