setProperty(key, newValue);
/** * Appends a value using a <U>comma</U> to an existing one. If no previous * value then same as calling {@link #setProperty(String, String)}. * * @param name Property name - never {@code null}/empty * @param value The value to be appended - ignored if {@code null}/empty * @return The value <U>before</U> appending - {@code null} if no previous value */ public String appendPropertyValue(String name, String value) { String key = ValidateUtils.checkNotNullAndNotEmpty(name, "No property name"); String curVal = getProperty(key); if (GenericUtils.isEmpty(value)) { return curVal; } if (GenericUtils.isEmpty(curVal)) { return setProperty(key, value); } return setProperty(key, curVal + ',' + value); }
setProperty(key, newValue);
/** * Appends a value using a <U>comma</U> to an existing one. If no previous * value then same as calling {@link #setProperty(String, String)}. * * @param name Property name - never {@code null}/empty * @param value The value to be appended - ignored if {@code null}/empty * @return The value <U>before</U> appending - {@code null} if no previous value */ public String appendPropertyValue(String name, String value) { String key = ValidateUtils.checkNotNullAndNotEmpty(name, "No property name"); String curVal = getProperty(key); if (GenericUtils.isEmpty(value)) { return curVal; } if (GenericUtils.isEmpty(curVal)) { return setProperty(key, value); } return setProperty(key, curVal + ',' + value); }