[New] Added ParameterizedElement.toObjectMap()
This commit is contained in:
parent
aec29adcd1
commit
2f6b7e7b05
|
@ -16,9 +16,11 @@
|
|||
package li.strolch.model;
|
||||
|
||||
import static java.util.stream.Collectors.toList;
|
||||
import static java.util.stream.Collectors.toMap;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import li.strolch.exception.StrolchException;
|
||||
|
@ -275,6 +277,18 @@ public abstract class ParameterizedElement extends AbstractStrolchElement {
|
|||
return new HashSet<>(this.parameterMap.keySet());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a simple map where the keys are the IDs of the parameters and the values are the values of the
|
||||
* Parameters
|
||||
*
|
||||
* @return a simple map where the keys are the IDs of the parameters and the values are the values of the *
|
||||
* Parameters
|
||||
*/
|
||||
public Map<String, Object> toObjectMap() {
|
||||
return this.parameterMap.values().stream()
|
||||
.collect(toMap(StrolchElement::getId, (Function<Parameter<?>, Object>) Parameter::getValue));
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract void fillLocator(LocatorBuilder lb);
|
||||
|
||||
|
|
Loading…
Reference in New Issue