X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=binding%2Fmdsal-binding-generator-util%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fmdsal%2Fbinding%2Fmodel%2Futil%2FBindingTypes.java;h=3bb4e824d14a0981ec7abdf405b0188e332faa2d;hb=480afab4e0a0eb8d64367c0bd12fa3ec892a3383;hp=46d487a9c485f28c68c0b9e96aa2bc379a06e42c;hpb=69edd49f361f97da4a99378830ca9aa2f34b97ae;p=mdsal.git diff --git a/binding/mdsal-binding-generator-util/src/main/java/org/opendaylight/mdsal/binding/model/util/BindingTypes.java b/binding/mdsal-binding-generator-util/src/main/java/org/opendaylight/mdsal/binding/model/util/BindingTypes.java index 46d487a9c4..3bb4e824d1 100644 --- a/binding/mdsal-binding-generator-util/src/main/java/org/opendaylight/mdsal/binding/model/util/BindingTypes.java +++ b/binding/mdsal-binding-generator-util/src/main/java/org/opendaylight/mdsal/binding/model/util/BindingTypes.java @@ -27,9 +27,13 @@ import org.opendaylight.yangtools.yang.binding.DataRoot; import org.opendaylight.yangtools.yang.binding.Identifiable; import org.opendaylight.yangtools.yang.binding.Identifier; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.opendaylight.yangtools.yang.binding.InstanceNotification; +import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier; import org.opendaylight.yangtools.yang.binding.KeyedListAction; +import org.opendaylight.yangtools.yang.binding.KeyedListNotification; import org.opendaylight.yangtools.yang.binding.Notification; import org.opendaylight.yangtools.yang.binding.NotificationListener; +import org.opendaylight.yangtools.yang.binding.OpaqueObject; import org.opendaylight.yangtools.yang.binding.RpcInput; import org.opendaylight.yangtools.yang.binding.RpcOutput; import org.opendaylight.yangtools.yang.binding.RpcService; @@ -67,7 +71,11 @@ public final class BindingTypes { private static final ConcreteType ACTION = typeForClass(Action.class); private static final ConcreteType CHILD_OF = typeForClass(ChildOf.class); private static final ConcreteType CHOICE_IN = typeForClass(ChoiceIn.class); + private static final ConcreteType INSTANCE_NOTIFICATION = typeForClass(InstanceNotification.class); + private static final ConcreteType KEYED_INSTANCE_IDENTIFIER = typeForClass(KeyedInstanceIdentifier.class); private static final ConcreteType KEYED_LIST_ACTION = typeForClass(KeyedListAction.class); + private static final ConcreteType KEYED_LIST_NOTIFICATION = typeForClass(KeyedListNotification.class); + private static final ConcreteType OPAQUE_OBJECT = typeForClass(OpaqueObject.class); private static final ConcreteType RPC_RESULT = typeForClass(RpcResult.class); private BindingTypes() { @@ -102,6 +110,30 @@ public final class BindingTypes { return parameterizedTypeFor(KEYED_LIST_ACTION, keyType, parent, input, output); } + /** + * Type specializing {@link InstanceNotification} for a particular type. + * + * @param parent Type of parent defining the notification + * @return A parameterized type corresponding to {@code InstanceNotification} + * @throws NullPointerException if {@code parent} is is null + */ + public static ParameterizedType instanceNotification(final Type concreteType, final Type parent) { + return parameterizedTypeFor(INSTANCE_NOTIFICATION, concreteType, parent); + } + + /** + * Type specializing {@link InstanceNotification} for a particular type. + * + * @param parent Type of parent defining the notification + * @param keyType Type of parent's key + * @return A parameterized type corresponding to {@code KeyedInstanceNotification} + * @throws NullPointerException if any argument is is null + */ + public static ParameterizedType keyedListNotification(final Type concreteType, final Type parent, + final Type keyType) { + return parameterizedTypeFor(KEYED_LIST_NOTIFICATION, concreteType, parent, keyType); + } + /** * Specialize {@link Augmentable} for a particular type. * @@ -168,6 +200,29 @@ public final class BindingTypes { return parameterizedTypeFor(INSTANCE_IDENTIFIER, type); } + /** + * Type specializing {@link KeyedInstanceIdentifier} for a particular type. + * + * @param type Type for which to specialize + * @param keyType Type of key + * @return A parameterized type corresponding to {@code KeyedInstanceIdentifier} + * @throws NullPointerException if any argument is is null + */ + public static ParameterizedType keyedInstanceIdentifier(final Type type, final Type keyType) { + return parameterizedTypeFor(KEYED_INSTANCE_IDENTIFIER, type, keyType); + } + + /** + * Type specializing {@link OpaqueObject} for a particular type. + * + * @param type Type for which to specialize + * @return A parameterized type corresponding to {@code OpaqueObject} + * @throws NullPointerException if {@code type} is null + */ + public static ParameterizedType opaqueObject(final Type type) { + return parameterizedTypeFor(OPAQUE_OBJECT, type); + } + /** * Type specializing {@link RpcResult} for a particular type. *