[New] Added new method .getParameterBagsByType()

This commit is contained in:
Robert von Burg 2017-05-03 13:52:34 +02:00
parent 22538dc7fa
commit ca50609131
1 changed files with 17 additions and 0 deletions

View File

@ -19,8 +19,10 @@ import java.text.MessageFormat;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import li.strolch.exception.StrolchException;
import li.strolch.exception.StrolchModelException;
@ -225,6 +227,21 @@ public abstract class GroupedParameterizedElement extends AbstractStrolchElement
return parameterBag;
}
/**
* Returns the {@link ParameterBag ParameterBags} of the given type
*
* @param type
* the type of {@link ParameterBag} to return
*
* @return the {@link ParameterBag ParameterBags} of the given type
*/
public List<ParameterBag> getParameterBagsByType(String type) {
return this.parameterBagMap.values() //
.stream() //
.filter(map -> map.getType().equals(type)) //
.collect(Collectors.toList());
}
/**
* Adds the given {@link ParameterBag} to this {@link GroupedParameterizedElement}
*