aboutsummaryrefslogtreecommitdiffstats
path: root/common-parameters/src/main/java/org/onap/policy/common/parameters/annotations/Pattern.java
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2021-01-06 11:15:45 -0500
committerJim Hahn <jrh3@att.com>2021-01-06 13:04:34 -0500
commit8208cc4b1d8855eee3fe59c7a832abccb2a67ed7 (patch)
tree13676da07d974013935ed2980f7b08a7917bf0c3 /common-parameters/src/main/java/org/onap/policy/common/parameters/annotations/Pattern.java
parentf9add40e0d87baff4ed56529bc61c31a577dc93d (diff)
Support annotations on parameterized types
It appears that java.validation allows validation annotations to be used on the type parameters of Collection and Map classes. Updated the validation code to support that. Once policy-models has been updated to use this approach, the original @Items and @Entries annotations will be deprecated. Issue-ID: POLICY-2648 Change-Id: Ic953be485ebafc9869f72407518f6549585353c9 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'common-parameters/src/main/java/org/onap/policy/common/parameters/annotations/Pattern.java')
-rw-r--r--common-parameters/src/main/java/org/onap/policy/common/parameters/annotations/Pattern.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/common-parameters/src/main/java/org/onap/policy/common/parameters/annotations/Pattern.java b/common-parameters/src/main/java/org/onap/policy/common/parameters/annotations/Pattern.java
index a30d814c..91a74d70 100644
--- a/common-parameters/src/main/java/org/onap/policy/common/parameters/annotations/Pattern.java
+++ b/common-parameters/src/main/java/org/onap/policy/common/parameters/annotations/Pattern.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP
* ================================================================================
- * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,13 +21,14 @@
package org.onap.policy.common.parameters.annotations;
import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.TYPE_USE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
@Retention(RUNTIME)
-@Target(FIELD)
+@Target({FIELD, TYPE_USE})
public @interface Pattern {
/**