public interface PropertiesWriter extends PropertiesTrait
A contracts that specifies methods for writing property values. Note that property keys are immutable (added if they absent). Elements and entries can still be added to list and map elements.
Note that with respect to null keys and values the behavior the methods in contract are
dependent on the Map implementation returned by PropertiesTrait.getProperties()
| Modifier and Type | Method and Description |
|---|---|
default <E> PropertiesWriter |
addCollectionElement(String key,
E element)
Add the given element to a collection entry in the properties map with the given key.
|
default <K,V> PropertiesWriter |
addMapEntry(String key,
K entryKey,
V entryValue)
Add the given entryKey/entryValue pair to a map entry in the properties map with the
given key.
|
default <T> PropertiesWriter |
addProperty(String key,
T value)
Add the given key/value pair if it is absent.
|
default <T> T |
computeIfAbsent(String key,
Function<String,T> mappingFunction)
If the specified key is not already associated with a value (or is mapped to null),
attempts to compute its value using the given mapping function and enters it into this
map unless null.
|
getProperties, isEmptydefault <T> T computeIfAbsent(String key, Function<String,T> mappingFunction)
T - the value typekey - the key with which the specified value is to be associatedmappingFunction - the function to compute a valuedefault <T> PropertiesWriter addProperty(String key, T value)
T - the value typekey - the keyvalue - the valuedefault <E> PropertiesWriter addCollectionElement(String key, E element)
E - the element typekey - the properties map keyelement - the element that will be addeddefault <K,V> PropertiesWriter addMapEntry(String key, K entryKey, V entryValue)
K - the entry key typeV - the entry value typekey - the properties map keyentryKey - the new entry key that will be addedentryValue - the new entry value that will be addedCopyright © 2016–2018 Testify Project. All rights reserved.