diff options
author | Pamela Dragosh <pdragosh@research.att.com> | 2018-08-13 14:39:43 -0400 |
---|---|---|
committer | Pamela Dragosh <pdragosh@research.att.com> | 2018-08-13 14:39:50 -0400 |
commit | 2d381afcd78b61d8791ace22b676e88271b3bdce (patch) | |
tree | bfddd966d78d1683ca01124d00b1799389ade500 /utils/src/main/java/org/onap/policy/common/utils/properties/PropertyConfiguration.java | |
parent | 269e543ba89dbf553fc66227f7123a302f56b5b4 (diff) |
Fix checkstyle in utils
Cleared all the checkstyle in these 2 submodules.
Issue-ID: POLICY-881
Change-Id: I248e1894aebf549d5a4f8669a6466ec227d40b55
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'utils/src/main/java/org/onap/policy/common/utils/properties/PropertyConfiguration.java')
-rw-r--r-- | utils/src/main/java/org/onap/policy/common/utils/properties/PropertyConfiguration.java | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/utils/src/main/java/org/onap/policy/common/utils/properties/PropertyConfiguration.java b/utils/src/main/java/org/onap/policy/common/utils/properties/PropertyConfiguration.java index e72ebaba..653fe484 100644 --- a/utils/src/main/java/org/onap/policy/common/utils/properties/PropertyConfiguration.java +++ b/utils/src/main/java/org/onap/policy/common/utils/properties/PropertyConfiguration.java @@ -41,8 +41,8 @@ import org.onap.policy.common.utils.properties.exception.PropertyMissingExceptio * subclass. The values of the fields are set via <i>setXxx()</i> methods. As a result, if * a field is annotated and there is no corresponding <i>setXxx()</i> method, then an * exception will be thrown. - * <p> - * It is possible that an invalid <i>defaultValue</i> is specified via the + * + * <p>It is possible that an invalid <i>defaultValue</i> is specified via the * {@link Property} annotation. This could remain undetected until an optional property is * left out of the {@link Properties}. Consequently, this class will always validate a * {@link Property}'s default value, if the <i>defaultValue</i> is not empty or if @@ -120,23 +120,6 @@ public class PropertyConfiguration { } /** - * @param field field whose value is to be set - * @param prop property of interest - * @return the method to be used to set the field's value - * @throws PropertyAccessException if a "set" method cannot be identified - */ - private Method getSetter(Field field, Property prop) throws PropertyAccessException { - String nm = "set" + StringUtils.capitalize(field.getName()); - - try { - return this.getClass().getMethod(nm, field.getType()); - - } catch (NoSuchMethodException | SecurityException e) { - throw new PropertyAccessException(prop.name(), nm, e); - } - } - - /** * Sets a field's value from a particular property. * * @param setter method to be used to set the field's value @@ -167,6 +150,25 @@ public class PropertyConfiguration { } /** + * Get the setter. + * + * @param field field whose value is to be set + * @param prop property of interest + * @return the method to be used to set the field's value + * @throws PropertyAccessException if a "set" method cannot be identified + */ + private Method getSetter(Field field, Property prop) throws PropertyAccessException { + String nm = "set" + StringUtils.capitalize(field.getName()); + + try { + return this.getClass().getMethod(nm, field.getType()); + + } catch (NoSuchMethodException | SecurityException e) { + throw new PropertyAccessException(prop.name(), nm, e); + } + } + + /** * Gets a property value, coercing it to the field's type. * * @param field field whose value is to be set |