/** * Optionally sets the specified named property to have the specified value. * * @param name the name of the property * @param value the value of the property * * @return the {@link PropertiesBuilder} to which the property was added so * that further chained method calls, like to other * <code>setProperty(...)</code> methods on this class may be used */ public PropertiesBuilder setPropertyIfAbsent(String name, Object value) { if (containsProperty(name)) { return this; } else { return setProperty(name, value); } }
/** * Optionally sets the specified named property to use an {@link Iterator} * (to provide successive requests for the property with values from the said * {@link Iterator} when the {@link PropertiesBuilder} is realized) * * @param name the name of the property * @param iterator an {@link Iterator} that will provide successive property * values for the property when the {@link PropertiesBuilder} * is realized * * @return the {@link PropertiesBuilder} to which the property was added so * that further chained method calls, like to other * <code>setProperty(...)</code> methods on this class may be used. */ public PropertiesBuilder setPropertyIfAbsent(String name, Iterator<?> iterator) { if (containsProperty(name)) { return this; } else { return setProperty(name, iterator); } }
/** * Sets the specified named default property to have the specified value. * * @param name the name of the property * @param defaultValue the default value of the property * * @return the {@link PropertiesBuilder} to which the property was added so * that further chained method calls, like to other * <code>setProperty(...)</code> methods on this class may be used */ @Deprecated public PropertiesBuilder setDefaultProperty(String name, Object defaultValue) { if (containsProperty(name)) { properties.get(name).setDefaultValue(defaultValue); } else { properties.put(name, new Property(name, null, defaultValue)); } return this; }
/** * Sets the specified named property to have the specified value. * * @param name the name of the property * @param value the value of the property * * @return the {@link PropertiesBuilder} to which the property was added so * that further chained method calls, like to other * <code>setProperty(...)</code> methods on this class may be used */ public PropertiesBuilder setProperty(String name, Object value) { if (containsProperty(name)) { properties.get(name).setValue(value); } else { properties.put(name, new Property(name, value, null)); } return this; }
/** * Sets the specified named default property to use an {@link Iterator} to * provide successive property values when the {@link PropertiesBuilder} is realized. * * @param name the name of the property * @param defaultIterator the default {@link Iterator} that will provide * successive property values for the property when * the {@link PropertiesBuilder} is realized * * @return the {@link PropertiesBuilder} to which the property was added so * that further chained method calls, like to other * <code>setProperty(...)</code> methods on this class may be used */ @Deprecated public PropertiesBuilder setDefaultProperty(String name, Iterator<?> defaultIterator) { if (containsProperty(name)) { properties.get(name).setDefaultValue(defaultIterator); } else { properties.put(name, new Property(name, null, defaultIterator)); } return this; }
/** * Sets the specified named property to use an {@link Iterator}. * (to provide successive requests for the property with values from the said * {@link Iterator} when the {@link PropertiesBuilder} is realized) * * @param name the name of the property * @param iterator an {@link Iterator} that will provide successive property * values for the property when the {@link PropertiesBuilder} * is realized * * @return the {@link PropertiesBuilder} to which the property was added so * that further chained method calls, like to other * <code>setProperty(...)</code> methods on this class may be used. */ public PropertiesBuilder setProperty(String name, Iterator<?> iterator) { if (containsProperty(name)) { properties.get(name).setValue(iterator); } else { properties.put(name, new Property(name, iterator, null)); } return this; }