2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
10 import java.util.Optional;
11 import org.opendaylight.yangtools.yang.common.Revision;
12 import org.opendaylight.yangtools.yang.model.api.DocumentedNode;
13 import org.opendaylight.yangtools.yang.model.api.stmt.RevisionEffectiveStatement;
14 import org.opendaylight.yangtools.yang.model.api.stmt.RevisionStatement;
15 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
17 public final class RevisionEffectiveStatementImpl extends DeclaredEffectiveStatementBase<Revision, RevisionStatement>
18 implements DocumentedNode, RevisionEffectiveStatement {
20 private final String reference;
21 private final String description;
23 public RevisionEffectiveStatementImpl(final StmtContext<Revision, RevisionStatement, ?> ctx) {
26 final DescriptionEffectiveStatementImpl descStmt = firstEffective(DescriptionEffectiveStatementImpl.class);
27 if (descStmt != null) {
28 this.description = descStmt.argument();
30 this.description = null;
33 final ReferenceEffectiveStatementImpl refStmt = firstEffective(ReferenceEffectiveStatementImpl.class);
34 if (refStmt != null) {
35 this.reference = refStmt.argument();
37 this.reference = null;
42 public Optional<String> getDescription() {
43 return Optional.ofNullable(description);
47 public Optional<String> getReference() {
48 return Optional.ofNullable(reference);