aboutsummaryrefslogtreecommitdiffstats
path: root/common-parameters/src/main/java/org/onap/policy/common/parameters/GroupValidationResult.java
AgeCommit message (Collapse)AuthorFilesLines
2019-07-31Change to fix issues in overridden validations of ParameterGroupsa.sreekumar1-1/+6
Currently, for validation of nested ParameterGroup classes, a new GroupValidationResult is directly created instead of calling the validate method of nested classes. Thus any overridden validate methods won't work. This is fixed. Change-Id: I8ee9265b295cb68d67926128b5b68c217f341034 Issue-ID: POLICY-1744 Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
2019-06-14Change getCanonicalName() to getName() in commonJim Hahn1-1/+1
Per javadocs, getName() should generally be used instead of Class.getCanonicalName(). This change only applies to classes; it does not apply to File objects. Change-Id: Iea0995d1167f4837607f194d35f0193eeedeacd7 Issue-ID: POLICY-1646 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-06-13More sonar fixes in policy/commonJim Hahn1-82/+11
Note: this does not increase code coverage, but should fix other code issues. Resolved cyclomatic complexity issue in ParameterValidationResult. Refactored duplicate code in GroupValidationResult. Removed IOException from NetworkUtil "throws". Replaced null/empty string tests with StringUtils.isBlank(). Added @FunctionalInterface where needed. Replaced anonymous classes with lambda expressions. Replaced duplicate strings with a constant. Added private constructors for utility classes. Removed sleep() from tests. Removed unused parameter from method call. Made some protected methods private. Compute integrity monitor's state-transition table once. Use for-loop instead of iterator. Moved constructors. Fixed some checkstyle issues (tabs => spaces, trailing spaces). Change-Id: I9a962ca45c4ff3f212c6014da799d06f07b232ef Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-03-07Add NotNull and NotBlank parameter validationJim Hahn1-24/+46
Modified the ParameterValidator to support new NotNull and NotBlank annotations indicating that a field should not be null or blank. These annotations can be made at class level or individual field level. Moved annotations to their own subdirectory. Added a comment to a method. Extracted constant strings. Moved one annotation to the subclass level. Added support for "Min" annotation. Propagate validation errors up from nested items. Apply field-level validations, even when field is a ParameterGroup. Change-Id: Ic90df55487dc5db7b7b0be5397624d1957904a81 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-12-19Add support for parameter inheritanceliamfallon1-19/+59
Common parameter support does not allow for inheritance of parameters from a super class. This change allows inheritance of public and protected members from a parameter superclass to a parameter subclass. Issue-ID: POLICY-1222 Change-Id: Ia4f452abab80953b41784c44e4202e8d5405a197 Signed-off-by: liamfallon <liam.fallon@est.tech>
2018-09-21Fix policy/common checkstyle issuesPamela Dragosh1-1/+2
The root pom.xml had a syntax error in a declaration. The suppressions xml was not being found by the sub-modules. It was better to create a copy in each of the sub-modules where we will not be fixing abbreviations or the interface declarations in own java file. Added specific checkstyle files for each submodule. One interesting note for the InheritDoc tag. It seems that the mvn compile has a bug that interprets these as missing a period after the tag. Even though the parent interface has it correctly. It was easier to just remove it than duplicate. There are new JIRA's for that work to be done in Dublin. Fixed some spacing in pom's. Issue-ID: POLICY-1131 Change-Id: I5f845958ccefd50a3b7290662da43c994870f1f7 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-09-07Remove changing of access on par fieldsliamfallon1-18/+57
Parameter handling refactored to remove changing of access on fields in parameters, new implementation requires getters to be defined for all fields. Note: This change causes a knock on into distribution Change-Id: I172f5d9310caf92d6ea825ff93292019c00a47c3 Issue-ID: POLICY-1095 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-08-28Improvements to Parameter Srviceliamfallon1-26/+58
Add proper handling for optional parameters Add setName() to the parameter group interface to force definition of that method Add some convenience metnods to parameter service Issue-ID: POLICY-1035 Change-Id: Iaa9226f45215b00aff9b78ab5fc120c24a0af46d Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-08-09Fix bug in common-paramter validation serviceramverma1-2/+2
In GroupValidationResult & GroupMapValidationResult, the setResult method was not setting the actual status that it has recieved from the nested group rather it was setting its own status again. Due to which the validation status of overall ParameterGroup was coming as CLEAN even if a nested child has reported it as INVALID. Changed the expected validation result texts for TestValidation accordingly. Change-Id: I5943decce39574089ca74f9bbccbfbe66d8d542c Issue-ID: POLICY-1035 Signed-off-by: ramverma <ram.krishna.verma@ericsson.com>
2018-08-03Fix pom and checkstyle warnings in commonliamfallon1-2/+1
Some dependency versions are now managed in the master POM Checkstyle showed up some warnings in paramters and capabilities. Change-Id: Ifebd8a076bdb3fda626b5b1fda9324801bf58643 Issue-ID: POLICY-716 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-07-31Improve validation, add hierarchical validationliamfallon1-0/+324
Parameter validaiton updated to generically support nested groups of parameters, and nested maps of parameters. Unit test showing JSON parameter input added. Unit test showing YAML parameter inout added. Test parameter group classes moved into subdirectory This allows parameters to be unmarshaled seamlessly from JSON and YAML files. Change-Id: I768e11f31ee7f62299c4d5d95ab68a005d1aff16 Issue-ID: POLICY-922 Signed-off-by: liamfallon <liam.fallon@ericsson.com>