Add ChoiceIn marker interface
[mdsal.git] / binding / mdsal-binding-generator-util / src / main / java / org / opendaylight / mdsal / binding / model / util / BindingTypes.java
index 8a91172d062828f8be2adbd348355c03f7b295f0..4fed3ec04fc0f540bc1543be3436c24aa58bd78a 100644 (file)
@@ -11,12 +11,15 @@ import static org.opendaylight.mdsal.binding.model.util.Types.parameterizedTypeF
 import static org.opendaylight.mdsal.binding.model.util.Types.typeForClass;
 
 import org.opendaylight.mdsal.binding.model.api.ConcreteType;
+import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
 import org.opendaylight.mdsal.binding.model.api.ParameterizedType;
 import org.opendaylight.mdsal.binding.model.api.Type;
 import org.opendaylight.yangtools.yang.binding.Augmentable;
 import org.opendaylight.yangtools.yang.binding.Augmentation;
 import org.opendaylight.yangtools.yang.binding.BaseIdentity;
 import org.opendaylight.yangtools.yang.binding.ChildOf;
+import org.opendaylight.yangtools.yang.binding.ChoiceIn;
+import org.opendaylight.yangtools.yang.binding.DataContainer;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.DataRoot;
 import org.opendaylight.yangtools.yang.binding.Identifiable;
@@ -25,12 +28,14 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.Notification;
 import org.opendaylight.yangtools.yang.binding.NotificationListener;
 import org.opendaylight.yangtools.yang.binding.RpcService;
+import org.opendaylight.yangtools.yang.binding.annotations.RoutingContext;
 
 public final class BindingTypes {
 
     public static final ConcreteType AUGMENTABLE = typeForClass(Augmentable.class);
     public static final ConcreteType AUGMENTATION = typeForClass(Augmentation.class);
     public static final ConcreteType BASE_IDENTITY = typeForClass(BaseIdentity.class);
+    public static final ConcreteType DATA_CONTAINER = typeForClass(DataContainer.class);
     public static final ConcreteType DATA_OBJECT = typeForClass(DataObject.class);
     public static final ConcreteType DATA_ROOT = typeForClass(DataRoot.class);
     public static final ConcreteType IDENTIFIABLE = typeForClass(Identifiable.class);
@@ -40,18 +45,46 @@ public final class BindingTypes {
     public static final ConcreteType NOTIFICATION_LISTENER = typeForClass(NotificationListener.class);
     public static final ConcreteType RPC_SERVICE = typeForClass(RpcService.class);
 
+    // This is an annotation, we are current just referencing the type
+    public static final JavaTypeName ROUTING_CONTEXT = JavaTypeName.create(RoutingContext.class);
+
     private static final ConcreteType CHILD_OF = typeForClass(ChildOf.class);
+    private static final ConcreteType CHOICE_IN = typeForClass(ChoiceIn.class);
 
     private BindingTypes() {
 
     }
 
-    public static ParameterizedType augmentable(final Type t) {
-        return parameterizedTypeFor(AUGMENTABLE, t);
+    /**
+     * Specialize {@link Augmentable} for a particular type.
+     *
+     * @param type Type for which to specialize
+     * @return A parameterized type corresponding to {@code Augmentable<Type>}
+     * @throws NullPointerException if {@code type} is null
+     */
+    public static ParameterizedType augmentable(final Type type) {
+        return parameterizedTypeFor(AUGMENTABLE, type);
     }
 
-    public static ParameterizedType childOf(final Type t) {
-        return parameterizedTypeFor(CHILD_OF, t);
+    /**
+     * Specialize {@link ChildOf} for a particular type.
+     *
+     * @param type Type for which to specialize
+     * @return A parameterized type corresponding to {@code ChildOf<Type>}
+     * @throws NullPointerException if {@code type} is null
+     */
+    public static ParameterizedType childOf(final Type type) {
+        return parameterizedTypeFor(CHILD_OF, type);
     }
 
+    /**
+     * Type specializing {@link ChoiceIn} for a particular type.
+     *
+     * @param type Type for which to specialize
+     * @return A parameterized type corresponding to {@code ChoiceIn<Type>}
+     * @throws NullPointerException if {@code type} is null
+     */
+    public static ParameterizedType choiceIn(final Type type) {
+        return parameterizedTypeFor(CHOICE_IN, type);
+    }
 }