Populate model/ hierarchy
[yangtools.git] / model / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / MustDefinition.java
1 /*
2  * Copyright (c) 2013 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.model.api;
9
10 import org.opendaylight.yangtools.yang.model.api.stmt.MustEffectiveStatement;
11 import org.opendaylight.yangtools.yang.xpath.api.YangXPathExpression.QualifiedBound;
12
13 /**
14  * Contains methods for accessing constraint declaration for valid data in form
15  * of XPath expressions.<br>
16  * <br>
17  * <i>YANG example:<br>
18  * <code>must "ifType != 'ethernet' or (ifType = 'ethernet' and ifMTU = 1500)";</code>
19  * </i>
20  */
21 public interface MustDefinition extends ConstraintMetaDefinition, EffectiveStatementEquivalent<MustEffectiveStatement> {
22     /**
23      * Returns XPath expression which contains constraint.
24      *
25      * @return XPath expression which represents the value of the argument of the <code>must</code> YANG substatement.
26      */
27     default QualifiedBound getXpath() {
28         return asEffectiveStatement().argument();
29     }
30 }