diff options
author | Jim Hahn <jrh3@att.com> | 2020-12-18 15:53:20 -0500 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2020-12-18 21:17:12 -0500 |
commit | 5f1b1162d047d2a743f1ce57cc17494a6150c75c (patch) | |
tree | 2098ecd2bc94ec6d0d2325568651d2418b659084 /common-parameters/src/main/java/org/onap/policy/common/parameters/annotations/Valid.java | |
parent | e2756fa0a8054854dfaaac1c7fa064d207a0a4ae (diff) |
Make validators extensible
Modified the validator to make it extensible. Also added annotations
to:
- cascade a validation to a sub-object
- perform regex
- examine items in a list
- examine entries in a map
Still need more junit tests.
Issue-ID: POLICY-2648
Change-Id: I94f1b9e8fbf7a6b9b002d0b05cc9119bdfcf8bf2
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'common-parameters/src/main/java/org/onap/policy/common/parameters/annotations/Valid.java')
-rw-r--r-- | common-parameters/src/main/java/org/onap/policy/common/parameters/annotations/Valid.java | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/common-parameters/src/main/java/org/onap/policy/common/parameters/annotations/Valid.java b/common-parameters/src/main/java/org/onap/policy/common/parameters/annotations/Valid.java new file mode 100644 index 00000000..a3a1d59f --- /dev/null +++ b/common-parameters/src/main/java/org/onap/policy/common/parameters/annotations/Valid.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP + * ================================================================================ + * Copyright (C) 2020 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.common.parameters.annotations; + +import static java.lang.annotation.ElementType.FIELD; +import static java.lang.annotation.ElementType.TYPE; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +@Retention(RUNTIME) +@Target({TYPE, FIELD}) +public @interface Valid { + +} |