267030f82ab073d3f81d6d1142c061b8be253b9b
[yangtools.git] / yang / yang-parser-rfc7950 / src / main / java / org / opendaylight / yangtools / yang / parser / rfc7950 / stmt / if_feature / IfFeatureStatementRFC6020Support.java
1 /*
2  * Copyright (c) 2020 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.yang.parser.rfc7950.stmt.if_feature;
9
10 import org.opendaylight.yangtools.yang.model.api.stmt.IfFeatureExpr;
11 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
12 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContextUtils;
13
14 public final class IfFeatureStatementRFC6020Support extends AbstractIfFeatureStatementSupport  {
15     private static final IfFeatureStatementRFC6020Support INSTANCE = new IfFeatureStatementRFC6020Support();
16
17     private IfFeatureStatementRFC6020Support() {
18         // Hidden on purpose
19     }
20
21     public static IfFeatureStatementRFC6020Support getInstance() {
22         return INSTANCE;
23     }
24
25     @Override
26     public IfFeatureExpr parseArgumentValue(final StmtContext<?, ?, ?> ctx, final String value) {
27         return IfFeatureExpr.isPresent(StmtContextUtils.parseNodeIdentifier(ctx, value));
28     }
29 }