summaryrefslogtreecommitdiffstats
path: root/common-parameters
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2021-05-21 12:19:44 -0400
committerJim Hahn <jrh3@att.com>2021-05-21 13:08:54 -0400
commit601a09fd07960d3aadcf972ba7c72dcea9976aef (patch)
tree35d368fc7d8c7dd40e1f76b852ad03bee8780e2e /common-parameters
parentc7d24b07377cb00ce4c0c531c6d3dff25e04dc12 (diff)
Enhance toString methods in factory classes
The factory classes in policy-endpoints have toString() methods that return "[]" for their list contents. Updated the code to provide a list of the keys rather than just an empty list. Also replaced some toString() methods with lombok. Also replace StringBuilder with concatenation in some cases. Issue-ID: POLICY-3298 Change-Id: I64fca21a4b009f7e09fcc482b5d156753fb7e680 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'common-parameters')
-rw-r--r--common-parameters/src/main/java/org/onap/policy/common/parameters/ParameterValidationResult.java24
1 files changed, 8 insertions, 16 deletions
diff --git a/common-parameters/src/main/java/org/onap/policy/common/parameters/ParameterValidationResult.java b/common-parameters/src/main/java/org/onap/policy/common/parameters/ParameterValidationResult.java
index b68c62e2..7e56230d 100644
--- a/common-parameters/src/main/java/org/onap/policy/common/parameters/ParameterValidationResult.java
+++ b/common-parameters/src/main/java/org/onap/policy/common/parameters/ParameterValidationResult.java
@@ -157,21 +157,13 @@ public class ParameterValidationResult implements ValidationResult {
return null;
}
- var validationResultBuilder = new StringBuilder();
-
- validationResultBuilder.append(initialIndentation);
- validationResultBuilder.append("field \"");
- validationResultBuilder.append(getName());
- validationResultBuilder.append("\" type \"");
- validationResultBuilder.append(field.getType().getName());
- validationResultBuilder.append("\" value \"");
- validationResultBuilder.append(parameterValue);
- validationResultBuilder.append("\" ");
- validationResultBuilder.append(getStatus());
- validationResultBuilder.append(", ");
- validationResultBuilder.append(message);
- validationResultBuilder.append('\n');
-
- return validationResultBuilder.toString();
+ return initialIndentation
+ + "field \"" + getName()
+ + "\" type \"" + field.getType().getName()
+ + "\" value \"" + parameterValue
+ + "\" " + getStatus()
+ + ", "
+ + message
+ + '\n';
}
}