[New] Added GroupedParameterizedElement.getRelation[s]Param()

This commit is contained in:
Robert von Burg 2019-10-15 16:00:17 +02:00
parent d2bd1f415b
commit b19154c501
1 changed files with 19 additions and 0 deletions

View File

@ -16,6 +16,7 @@
package li.strolch.model;
import static java.util.stream.Collectors.toList;
import static li.strolch.model.StrolchModelConstants.BAG_RELATIONS;
import java.text.MessageFormat;
import java.util.*;
@ -24,6 +25,8 @@ import java.util.stream.Stream;
import li.strolch.exception.StrolchException;
import li.strolch.exception.StrolchModelException;
import li.strolch.model.parameter.Parameter;
import li.strolch.model.parameter.StringListParameter;
import li.strolch.model.parameter.StringParameter;
import li.strolch.utils.helper.StringHelper;
/**
@ -141,6 +144,22 @@ public abstract class GroupedParameterizedElement extends AbstractStrolchElement
return parameter;
}
public StringParameter getRelationParam(String paramKey) {
return getParameter(BAG_RELATIONS, paramKey, false);
}
public StringParameter getRelationParam(String paramKey, boolean assertExists) {
return getParameter(BAG_RELATIONS, paramKey, assertExists);
}
public StringListParameter getRelationsParam(String paramKey) {
return getParameter(BAG_RELATIONS, paramKey, false);
}
public StringListParameter getRelationsParam(String paramKey, boolean assertExists) {
return getParameter(BAG_RELATIONS, paramKey, assertExists);
}
/**
* Returns a {@link Stream} of all the {@link Parameter Parameters}
*