import com.google.common.base.Preconditions;
import com.google.common.base.Splitter;
import com.google.common.base.Strings;
-import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableMap.Builder;
import com.google.common.collect.ImmutableSet;
import org.opendaylight.yangtools.yang.model.api.DeviateKind;
import org.opendaylight.yangtools.yang.model.api.ModuleIdentifier;
import org.opendaylight.yangtools.yang.model.api.RevisionAwareXPath;
-import org.opendaylight.yangtools.yang.model.api.Rfc6020Mapping;
import org.opendaylight.yangtools.yang.model.api.Status;
import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;
import org.opendaylight.yangtools.yang.model.api.stmt.BelongsToStatement;
return false;
}
- public static boolean isPresenceContainer(final StatementContextBase<?, ?, ?> targetCtx) {
- if (!targetCtx.getPublicDefinition().equals(Rfc6020Mapping.CONTAINER)) {
- return false;
- }
-
- final List<StatementContextBase<?, ?, ?>> targetSubStatements = new ImmutableList.Builder<StatementContextBase<?, ?, ?>>()
- .addAll(targetCtx.declaredSubstatements()).addAll(targetCtx.effectiveSubstatements()).build();
- for (final StatementContextBase<?, ?, ?> subStatement : targetSubStatements) {
- if (subStatement.getPublicDefinition().equals(Rfc6020Mapping.PRESENCE)) {
- return true;
- }
- }
-
- return false;
- }
-
public static SourceIdentifier createSourceIdentifier(final RootStatementContext<?, ?, ?> root) {
final QNameModule qNameModule = root.getFromNamespace(ModuleCtxToModuleQName.class, root);
if (qNameModule != null) {