/* * Copyright (c) 2016 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.parser.rfc7950.stmt.action; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.model.api.ActionDefinition; import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement; import org.opendaylight.yangtools.yang.model.api.stmt.ActionEffectiveStatement; import org.opendaylight.yangtools.yang.model.api.stmt.ActionStatement; import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractEffectiveOperationDefinition; import org.opendaylight.yangtools.yang.parser.spi.meta.CopyHistory; import org.opendaylight.yangtools.yang.parser.spi.meta.CopyType; import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext; final class ActionEffectiveStatementImpl extends AbstractEffectiveOperationDefinition implements ActionDefinition, ActionEffectiveStatement { private final boolean augmenting; private final boolean addedByUses; ActionEffectiveStatementImpl( final StmtContext> ctx) { super(ctx); // initCopyType final CopyHistory copyTypesFromOriginal = ctx.getCopyHistory(); if (copyTypesFromOriginal.contains(CopyType.ADDED_BY_USES_AUGMENTATION)) { this.augmenting = true; this.addedByUses = true; } else { this.augmenting = copyTypesFromOriginal.contains(CopyType.ADDED_BY_AUGMENTATION); this.addedByUses = copyTypesFromOriginal.contains(CopyType.ADDED_BY_USES); } } @Deprecated @Override public boolean isAugmenting() { return augmenting; } @Deprecated @Override public boolean isAddedByUses() { return addedByUses; } }