/** * Sets a property with the given name to the specified {@link String} value. The property is only set * if the value is not {@literal null}, an empty {@link String} or not equal to the {@link String} literal * {@literal null}, ignoring case. * * @param name the name of the property to set. * @param value the value to set the property to. * @return a reference to this {@link PropertiesBuilder}. * @throws IllegalArgumentException if the property name is not specified. * @see java.util.Properties#setProperty(String, String) */ public PropertiesBuilder setProperty(String name, String value) { Assert.hasText(name, String.format("Name [%s] must be specified", name)); if (isValuable(value)) { this.properties.setProperty(name, value); } return this; }
/** * Sets a property with the given name to the specified {@link String} value. The property is only set * if the value is not {@literal null}, an empty {@link String} or not equal to the {@link String} literal * {@literal null}, ignoring case. * * @param name the name of the property to set. * @param value the value to set the property to. * @return a reference to this {@link PropertiesBuilder}. * @throws IllegalArgumentException if the property name is not specified. * @see java.util.Properties#setProperty(String, String) */ public PropertiesBuilder setProperty(String name, String value) { Assert.hasText(name, String.format("Name [%s] must be specified", name)); if (isValuable(value)) { this.properties.setProperty(name, value); } return this; }