2 * Copyright (c) 2019 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.parser.rfc7950.stmt;
10 import com.google.common.collect.ImmutableSet;
11 import java.lang.invoke.MethodHandles;
12 import java.lang.invoke.VarHandle;
13 import org.opendaylight.yangtools.yang.common.QName;
14 import org.opendaylight.yangtools.yang.model.api.MustConstraintAware;
15 import org.opendaylight.yangtools.yang.model.api.MustDefinition;
16 import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
17 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
19 @Deprecated(forRemoval = true)
20 public abstract class AbstractEffectiveMustConstraintAwareDataSchemaNode<D extends DeclaredStatement<QName>>
21 extends AbstractEffectiveDataSchemaNode<D> implements MustConstraintAware {
22 private static final VarHandle MUST_CONSTRAINTS;
26 MUST_CONSTRAINTS = MethodHandles.lookup().findVarHandle(
27 AbstractEffectiveMustConstraintAwareDataSchemaNode.class, "mustConstraints", ImmutableSet.class);
28 } catch (NoSuchFieldException | IllegalAccessException e) {
29 throw new ExceptionInInitializerError(e);
33 @SuppressWarnings("unused")
34 private volatile ImmutableSet<MustDefinition> mustConstraints;
36 protected AbstractEffectiveMustConstraintAwareDataSchemaNode(final StmtContext<QName, D, ?> ctx) {
41 public final ImmutableSet<MustDefinition> getMustConstraints() {
42 return derivedSet(MUST_CONSTRAINTS, MustDefinition.class);