Implement DocumentedNode interface to RevisionEffectiveStatementImpl
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / stmt / rfc6020 / effective / RevisionEffectiveStatementImpl.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
9
10 import java.util.Date;
11 import org.opendaylight.yangtools.yang.model.api.DocumentedNode;
12 import org.opendaylight.yangtools.yang.model.api.stmt.RevisionStatement;
13 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
14
15 public final class RevisionEffectiveStatementImpl extends DeclaredEffectiveStatementBase<Date, RevisionStatement>
16         implements DocumentedNode {
17
18     private final String reference;
19     private final String description;
20
21     public RevisionEffectiveStatementImpl(final StmtContext<Date, RevisionStatement, ?> ctx) {
22         super(ctx);
23
24         final DescriptionEffectiveStatementImpl descStmt = firstEffective(DescriptionEffectiveStatementImpl.class);
25         if (descStmt != null) {
26             this.description = descStmt.argument();
27         } else {
28             this.description = null;
29         }
30
31         final ReferenceEffectiveStatementImpl refStmt = firstEffective(ReferenceEffectiveStatementImpl.class);
32         if (refStmt != null) {
33             this.reference = refStmt.argument();
34         } else {
35             this.reference = null;
36         }
37     }
38
39     @Override
40     public final String getDescription() {
41         return this.description;
42     }
43
44     @Override
45     public final String getReference() {
46         return this.reference;
47     }
48 }