a3034e8915202ea3a42a4e8cfb2926ea2424cea6
[yangtools.git] / parser / rfc8528-parser-support / src / main / java / org / opendaylight / yangtools / rfc8528 / parser / MountPointEffectiveStatementImpl.java
1 /*
2  * Copyright (c) 2019 PANTHEON.tech, s.r.o. 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.rfc8528.parser;
9
10 import static com.google.common.base.Verify.verifyNotNull;
11
12 import com.google.common.collect.ImmutableList;
13 import org.eclipse.jdt.annotation.Nullable;
14 import org.opendaylight.yangtools.rfc8528.model.api.MountPointEffectiveStatement;
15 import org.opendaylight.yangtools.rfc8528.model.api.MountPointSchemaNode;
16 import org.opendaylight.yangtools.rfc8528.model.api.MountPointStatement;
17 import org.opendaylight.yangtools.yang.common.QName;
18 import org.opendaylight.yangtools.yang.model.api.SchemaNodeDefaults;
19 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
20 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
21 import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.UnknownEffectiveStatementBase;
22 import org.opendaylight.yangtools.yang.parser.spi.meta.EffectiveStmtCtx.Current;
23
24 final class MountPointEffectiveStatementImpl extends UnknownEffectiveStatementBase<QName, MountPointStatement>
25         implements MountPointEffectiveStatement, MountPointSchemaNode {
26     private final @Nullable SchemaPath path;
27
28     MountPointEffectiveStatementImpl(final Current<QName, MountPointStatement> stmt,
29             final ImmutableList<? extends EffectiveStatement<?, ?>> substatements, final @Nullable SchemaPath path) {
30         super(stmt, substatements);
31         this.path = path;
32     }
33
34     @Override
35     public QName getQName() {
36         return verifyNotNull(argument());
37     }
38
39     @Override
40     @Deprecated
41     public SchemaPath getPath() {
42         return SchemaNodeDefaults.throwUnsupportedIfNull(this, path);
43     }
44
45     @Override
46     public MountPointEffectiveStatement asEffectiveStatement() {
47         return this;
48     }
49 }