Fix leafref require-instance implementation
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / type / RequireInstanceRestrictedTypeDefinition.java
diff --git a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/type/RequireInstanceRestrictedTypeDefinition.java b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/type/RequireInstanceRestrictedTypeDefinition.java
new file mode 100644 (file)
index 0000000..b04fd8e
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yangtools.yang.model.api.type;
+
+import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
+
+/**
+ * Interface for {@link TypeDefinition}s which can be restricted through a require-instance statement.
+ *
+ * @param <T> Concrete {@link TypeDefinition} subinterface
+ */
+public interface RequireInstanceRestrictedTypeDefinition<T extends TypeDefinition<T>> extends TypeDefinition<T> {
+    /**
+     * Returns true or false which represents argument of <code>require-instance</code> statement. This statement is
+     * the substatement of the <code>type</code> statement.
+     *
+     * @return boolean value which is true if the <code>require-instance</code> statement is true and vice versa
+     */
+    boolean requireInstance();
+}