public final class PropertyChangeSetBuilder extends Object
PropertySource
instance. If the provider is mutable it may check the
version given and applyChanges the changes to the provider/configuration, including triggering current regarding
change events.
For appropriate conversion a Function<String, Codec>
can be applied, which performs correct conversion,
when changed values are set. This function enables connecting e.g. setters on a configuration template with
the corresponding conversion logic, so the template calls are correctly converted back.
Modifier and Type | Method and Description |
---|---|
PropertyChangeSetBuilder |
add(String... keys)
Marks the given key(s) as added.
|
PropertyChangeSetBuilder |
addChanges(Map<String,String> map1,
Map<String,String> map2)
Compares the two property maps and adds the corresponding updated/aded/removed keys to the builder.
|
PropertyChangeSet |
build()
Builds s new change set.
|
static PropertyChangeSetBuilder |
of(PropertySource source)
Creates a new instance current this builder.
|
PropertyChangeSetBuilder |
remove(String... keys)
Marks the given key(s) as removed.
|
String |
toString() |
PropertyChangeSetBuilder |
update(String... keys)
Marks the given key(s) as updaed.
|
public static PropertyChangeSetBuilder of(PropertySource source)
source
- the underlying property provider/configuration, not null.public PropertyChangeSetBuilder remove(String... keys)
keys
- the keys removedpublic PropertyChangeSetBuilder add(String... keys)
keys
- the keys addedpublic PropertyChangeSetBuilder update(String... keys)
keys
- the keys updatedpublic PropertyChangeSetBuilder addChanges(Map<String,String> map1, Map<String,String> map2)
map1
- the source map, not null.map2
- the target map, not null.public PropertyChangeSet build()
Copyright © 2014–2015 Apache Software Foundation. All rights reserved.