aboutsummaryrefslogtreecommitdiffstats
path: root/common-parameters/src/main/java/org/onap/policy/common/parameters/FieldValidator.java
AgeCommit message (Collapse)AuthorFilesLines
2021-06-01Validator should report serialized field nameJim Hahn1-1/+11
The validator reports field names as they appear in the class rather than as they appear on the wire, which may be confusing to the client. Modified the code to use the serialized name instead. Note: this will require tweaks to some junits in some of the other policy repos. Issue-ID: POLICY-3333 Change-Id: I867dafdc87cd78dec3d3c6fe0236a744284314a3 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-05-06Fix sonars in policy-commonJim Hahn1-8/+8
Fixed sonars: - use "var" instead of actual type name - re-interrupt threads - use rej2 split() instead of String split() Issue-ID: POLICY-3285 Change-Id: I82261e0b8a53ee5c5264556fbf5cec37454f014e Signed-off-by: Jim Hahn <jrh3@att.com>
2021-01-07Deprecate old validation annotationsJim Hahn1-3/+3
Removed @Items and @Entries validation annotations, as they are no longer needed. Issue-ID: POLICY-2648 Change-Id: I68b78738d520ad96175567572e3c2f4a845dae44 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-01-06Support annotations on parameterized typesJim Hahn1-0/+65
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>
2021-01-04Update junits for ValidationJim Hahn1-4/+5
The Validation code was previously refactored. Added/updated junits correspondingly. Issue-ID: POLICY-2648 Change-Id: I570c0ec692ecfcb6e69ada45f7997f6e63735ea0 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-12-18Make validators extensibleJim Hahn1-0/+216
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>