2 * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others. All rights reserved.
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
8 package org.opendaylight.yangtools.yang.model.ri.stmt.impl.eff;
10 import com.google.common.collect.ImmutableList;
11 import com.google.common.collect.ImmutableSet;
12 import java.util.Collection;
13 import org.eclipse.jdt.annotation.NonNull;
14 import org.opendaylight.yangtools.concepts.Immutable;
15 import org.opendaylight.yangtools.yang.model.api.IdentitySchemaNode;
16 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
17 import org.opendaylight.yangtools.yang.model.api.stmt.IdentityStatement;
19 public final class RegularIdentityEffectiveStatement extends AbstractIdentityEffectiveStatement {
20 private final @NonNull Object baseIdentities;
21 private final @NonNull Object substatements;
22 private final int flags;
24 public RegularIdentityEffectiveStatement(final IdentityStatement declared, final Immutable path, final int flags,
25 final ImmutableList<? extends EffectiveStatement<?, ?>> substatements,
26 final ImmutableSet<? extends IdentitySchemaNode> baseIdentities) {
27 super(declared, path);
29 this.substatements = maskList(substatements);
30 this.baseIdentities = maskSet(baseIdentities);
34 public Collection<? extends IdentitySchemaNode> getBaseIdentities() {
35 return unmaskSet(baseIdentities, IdentitySchemaNode.class);
44 public ImmutableList<? extends EffectiveStatement<?, ?>> effectiveSubstatements() {
45 return unmaskList(substatements);