Adjust test suite parser update to conform with API changes
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / rfc7950 / stmt / AbstractEffectiveContainerSchemaNode.java
1 /*
2  * Copyright (c) 2015 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.parser.rfc7950.stmt;
9
10 import com.google.common.collect.ImmutableSet;
11 import java.util.Collection;
12 import org.opendaylight.yangtools.yang.common.QName;
13 import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
14 import org.opendaylight.yangtools.yang.model.api.MustDefinition;
15 import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
16 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
17
18 public abstract class AbstractEffectiveContainerSchemaNode<D extends DeclaredStatement<QName>>
19         extends AbstractEffectiveSimpleDataNodeContainer<D> implements ContainerSchemaNode {
20     private final Collection<MustDefinition> mustConstraints;
21
22     protected AbstractEffectiveContainerSchemaNode(final StmtContext<QName, D, ?> ctx) {
23         super(ctx);
24         mustConstraints = ImmutableSet.copyOf(allSubstatementsOfType(MustDefinition.class));
25     }
26
27     @Override
28     public final Collection<MustDefinition> getMustConstraints() {
29         return mustConstraints;
30     }
31 }