BUG-6522: create a specialized CopyHistory object
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / spi / meta / StmtContext.java
index fd44a86e0d4a06951d2a943ee2505839d0648fd0..b49363f991551e002685471d47371bd35ba53953 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.yangtools.yang.parser.spi.meta;
 
 import com.google.common.base.Optional;
 import java.util.Collection;
-import java.util.List;
 import java.util.Map;
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
@@ -88,18 +87,14 @@ public interface StmtContext<A, D extends DeclaredStatement<A>, E extends Effect
     void addAsEffectOfStatement(StatementContextBase<?, ?, ?> ctx);
 
     StatementContextBase<?, ?, ?> createCopy(
-            StatementContextBase<?, ?, ?> newParent, TypeOfCopy typeOfCopy)
+            StatementContextBase<?, ?, ?> newParent, CopyType typeOfCopy)
             throws SourceException;
 
     StatementContextBase<?, ?, ?> createCopy(QNameModule newQNameModule,
-            StatementContextBase<?, ?, ?> newParent, TypeOfCopy typeOfCopy)
+            StatementContextBase<?, ?, ?> newParent, CopyType typeOfCopy)
             throws SourceException;
 
-    enum TypeOfCopy {
-        ORIGINAL, ADDED_BY_USES, ADDED_BY_AUGMENTATION, ADDED_BY_USES_AUGMENTATION
-    }
-
-    List<TypeOfCopy> getCopyHistory();
+    CopyHistory getCopyHistory();
 
     enum SupportedByFeatures {
         UNDEFINED, SUPPORTED, NOT_SUPPORTED
@@ -107,9 +102,7 @@ public interface StmtContext<A, D extends DeclaredStatement<A>, E extends Effect
 
     SupportedByFeatures getSupportedByFeatures();
 
-    void addAllToCopyHistory(List<TypeOfCopy> typeOfCopyList);
-
-    void addToCopyHistory(TypeOfCopy typeOfCopy);
+    void appendCopyHistory(CopyType typeOfCopy, CopyHistory toAppend);
 
     StatementContextBase<?, ?, ?> getOriginalCtx();