public class PropertyStoreBuilder extends Object
PropertyStore
objects.Modifier and Type | Method and Description |
---|---|
PropertyStoreBuilder |
add(Map<String,Object> newProperties)
Convenience method for setting multiple properties in one call.
|
PropertyStoreBuilder |
addTo(String key,
Object value)
Adds a value to a SET, LIST, or MAP property.
|
PropertyStoreBuilder |
addTo(String key,
String arg,
Object value)
Adds one or more values to a SET, LIST, or MAP property.
|
PropertyStoreBuilder |
apply(PropertyStore copyFrom)
Copies all the values in the specified property store into this builder.
|
PropertyStore |
build()
Creates a new
PropertyStore based on the values in this builder. |
void |
clear()
Clears all entries in this property store.
|
Object |
peek(String key)
Peeks at a property value.
|
PropertyStoreBuilder |
remove(String key)
Removes the property with the specified key.
|
PropertyStoreBuilder |
removeFrom(String key,
Object value)
Removes a value from a SET or LIST property.
|
PropertyStoreBuilder |
set(Map<String,Object> newProperties)
Convenience method for setting multiple properties in one call.
|
PropertyStoreBuilder |
set(String key,
Object value)
Sets a configuration property value on this object.
|
public PropertyStore build()
PropertyStore
based on the values in this builder.PropertyStore
based on the values in this builder.public PropertyStoreBuilder apply(PropertyStore copyFrom)
copyFrom
- The property store to copy the values from.public PropertyStoreBuilder set(String key, Object value)
key
- The configuration property key.
value
- The new value.
If public PropertyStoreBuilder remove(String key)
This is equivalent to calling set(key,
key
- The property key.public PropertyStoreBuilder set(Map<String,Object> newProperties)
This replaces any previous configuration properties set on this store.
newProperties
- The new properties to set.public PropertyStoreBuilder add(Map<String,Object> newProperties)
This appends to any previous configuration properties set on this store.
newProperties
- The new properties to set.public PropertyStoreBuilder addTo(String key, String arg, Object value)
key
- The property key.arg
- The argument.
value
- The new value to add to the property.
ConfigException
- If property is not a SET/LIST/MAP property, or the argument is invalid.public PropertyStoreBuilder addTo(String key, Object value)
Shortcut for calling addTo(key,
.
key
- The property key.value
- The new value to add to the property.
ConfigException
- If property is not a SET/LIST/MAP property, or the argument is invalid.public PropertyStoreBuilder removeFrom(String key, Object value)
key
- The property key.value
- The property value in the property.ConfigException
- If property is not a SET or LIST property.public Object peek(String key)
Used for debugging purposes.
key
- The property key.public void clear()
Copyright © 2018 Apache. All rights reserved.