fbed61b263c8d6edb7308bbbcabde73c522d811c
[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.stmt.RevisionStatement;
12 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
13
14 public final class RevisionEffectiveStatementImpl extends DeclaredEffectiveStatementBase<Date, RevisionStatement> {
15     private final String reference;
16     private final String description;
17
18     public RevisionEffectiveStatementImpl(final StmtContext<Date, RevisionStatement, ?> ctx) {
19         super(ctx);
20
21         DescriptionEffectiveStatementImpl descStmt = firstEffective(DescriptionEffectiveStatementImpl.class);
22         if (descStmt != null) {
23             description = descStmt.argument();
24         } else {
25             description = null;
26         }
27
28         ReferenceEffectiveStatementImpl refStmt = firstEffective(ReferenceEffectiveStatementImpl.class);
29         if (refStmt != null) {
30             reference = refStmt.argument();
31         } else {
32             reference = null;
33         }
34     }
35
36     public final String getDescription() {
37         return description;
38     }
39
40     public final String getReference() {
41         return reference;
42     }
43 }