0c9cda2c629257c974ed4102c623bc060c5a9c22
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / stmt / ModifierStatement.java
1 /*
2  * Copyright (c) 2016 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
9 package org.opendaylight.yangtools.yang.model.api.stmt;
10
11 import static com.google.common.base.Verify.verifyNotNull;
12
13 import com.google.common.annotations.Beta;
14 import org.eclipse.jdt.annotation.NonNull;
15 import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
16 import org.opendaylight.yangtools.yang.model.api.type.ModifierKind;
17
18 /**
19  * Represents YANG modifier statement.
20  *
21  * <p>
22  * The "modifier" statement, which is an optional substatement to the "pattern" statement, takes as an argument
23  * the string "invert-match". If a pattern has the "invert-match" modifier present, the type is restricted to values
24  * that do not match the pattern.
25  */
26 @Beta
27 public interface ModifierStatement extends DeclaredStatement<ModifierKind> {
28     default @NonNull ModifierKind getValue() {
29         // FIXME: YANGTOOLS-908: verifyNotNull() should not be needed here
30         return verifyNotNull(argument());
31     }
32 }