Rework AugmentRuntimeType and Choice/Case linkage
[mdsal.git] / binding / mdsal-binding-runtime-api / src / main / java / org / opendaylight / mdsal / binding / runtime / api / ChoiceRuntimeType.java
index 9a2fa97b3b024bb3717dde2434bb07322f669c87..63fcb19bb32b8152b7f92896f9c8b2b034629d58 100644 (file)
@@ -12,10 +12,12 @@ import java.util.Collection;
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
 import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
+import org.opendaylight.yangtools.yang.binding.Augmentable;
 import org.opendaylight.yangtools.yang.model.api.stmt.ChoiceEffectiveStatement;
 
 /**
- * A {@link RuntimeType} associated with a {@code choice} statement.
+ * A {@link RuntimeType} associated with a {@code choice} statement. Note that unlike YANG semantics, in Binding Spec
+ * semantics a type generated for a 'choice' statement is <b>does not</b> implement {@link Augmentable}.
  */
 @Beta
 public interface ChoiceRuntimeType extends CompositeRuntimeType, DataRuntimeType {
@@ -31,56 +33,10 @@ public interface ChoiceRuntimeType extends CompositeRuntimeType, DataRuntimeType
      */
     @Nullable CaseRuntimeType bindingCaseChild(JavaTypeName typeName);
 
-    /**
-     * Return the runtime type for the original manifestation of this type's {@code choice} statement.
-     * Returns {@code null} if this type is the original.
-     *
-     * @return Original manifestatation, or {@code null} if this is the original manifestation.
-     */
-    @Nullable ChoiceRuntimeType originalType();
-
     /**
      * Return all {@link CaseRuntimeType} valid at this type's statement.
      *
      * @return Valid {@link CaseRuntimeType}s
      */
     @NonNull Collection<CaseRuntimeType> validCaseChildren();
-
-    /**
-     * Return any additional {@link CaseRuntimeType}s which may be encountered when dealing with DataObjects supported
-     * by this type. These are not strictly valid in YANG view of modeled data, but may have potentially-equivalent
-     * representation, such as in the following case:
-     * <pre>
-     *   <code>
-     *     grouping one {
-     *       container foo {
-     *         choice bar;
-     *       }
-     *     }
-     *
-     *     container foo {
-     *       uses grp;
-     *     }
-     *
-     *     container bar {
-     *       uses grp;
-     *     }
-     *
-     *     augment /foo/foo/bar {
-     *       case baz
-     *     }
-     *
-     *     augment /bar/foo/bar {
-     *       case xyzzy;
-     *     }
-     *   </code>
-     * </pre>
-     * and, more notably, the two augments being in different modules. Since {@code choice bar}'s is part of a reusable
-     * construct, {@code grouping one}, DataObjects' copy builders can propagate them without translating them to the
-     * appropriate manifestation -- and they can do nothing about that as they lack the complete view of the effecitve
-     * model.
-     *
-     * @return Additional {@link CaseRuntimeType}s
-     */
-    @NonNull Collection<CaseRuntimeType> additionalCaseChildren();
 }