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=903740e53c8c2619f3c1ee5023876b3b8f08bd4c;hb=a07668d09b87d8f671e774a13583a3c3c0b41369;hp=117276462d717e86f55dc74f503f9d4a3570aab0;hpb=c241dcfa5322ac10810a1068ccd2eb57f6f2dbb2;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 117276462d..903740e53c 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 @@ -11,6 +11,7 @@ import static org.opendaylight.mdsal.binding.model.util.Types.parameterizedTypeF import static org.opendaylight.mdsal.binding.model.util.Types.typeForClass; import com.google.common.annotations.VisibleForTesting; +import org.eclipse.jdt.annotation.NonNull; import org.opendaylight.mdsal.binding.model.api.ConcreteType; import org.opendaylight.mdsal.binding.model.api.JavaTypeName; import org.opendaylight.mdsal.binding.model.api.ParameterizedType; @@ -27,12 +28,17 @@ 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; +import org.opendaylight.yangtools.yang.binding.TypeObject; import org.opendaylight.yangtools.yang.binding.annotations.RoutingContext; import org.opendaylight.yangtools.yang.common.RpcResult; @@ -41,6 +47,7 @@ public final class BindingTypes { 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 TYPE_OBJECT = typeForClass(TypeObject.class); public static final ConcreteType DATA_ROOT = typeForClass(DataRoot.class); public static final ConcreteType NOTIFICATION = typeForClass(Notification.class); public static final ConcreteType NOTIFICATION_LISTENER = typeForClass(NotificationListener.class); @@ -65,7 +72,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() { @@ -100,6 +111,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. * @@ -107,7 +142,7 @@ public final class BindingTypes { * @return A parameterized type corresponding to {@code Augmentable} * @throws NullPointerException if {@code type} is null */ - public static ParameterizedType augmentable(final Type type) { + public static @NonNull ParameterizedType augmentable(final Type type) { return parameterizedTypeFor(AUGMENTABLE, type); } @@ -166,6 +201,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. *