diff --git a/li.strolch.model/src/main/java/li/strolch/model/GroupedParameterizedElement.java b/li.strolch.model/src/main/java/li/strolch/model/GroupedParameterizedElement.java index a9b1979c8..11a1300ec 100644 --- a/li.strolch.model/src/main/java/li/strolch/model/GroupedParameterizedElement.java +++ b/li.strolch.model/src/main/java/li/strolch/model/GroupedParameterizedElement.java @@ -960,6 +960,17 @@ public abstract class GroupedParameterizedElement extends AbstractStrolchElement return bag.hasParameter(paramKey); } + @Override + public boolean isRelationSet(String paramKey) { + if (this.parameterBagMap == null) + return false; + ParameterBag bag = this.parameterBagMap.get(BAG_RELATIONS); + if (bag == null) + return false; + StringParameter relationP = bag.getStringP(paramKey); + return relationP != null && relationP.isSet(); + } + @Override public boolean hasParameter(String bagKey, String paramKey) { if (this.parameterBagMap == null) { diff --git a/li.strolch.model/src/main/java/li/strolch/model/ParameterBagContainer.java b/li.strolch.model/src/main/java/li/strolch/model/ParameterBagContainer.java index c4d3ff34f..e16bc40cc 100644 --- a/li.strolch.model/src/main/java/li/strolch/model/ParameterBagContainer.java +++ b/li.strolch.model/src/main/java/li/strolch/model/ParameterBagContainer.java @@ -1624,6 +1624,19 @@ public interface ParameterBagContainer extends StrolchElement { */ boolean hasRelation(String paramKey); + /** + * Returns true if the {@link Parameter} with the given paramKey exists on the {@link ParameterBag} with the id + * {@link StrolchModelConstants#BAG_RELATIONS} and the value of the parameter is also set, i.e. not empty + * + * @param paramKey + * the key of the {@link Parameter} to be found + * + * @return true if the {@link Parameter} with the given paramKey exists on the {@link ParameterBag} with the given + * bagKey and the value of the parameter is also set, i.e. not empty. False is returned if the {@link ParameterBag} does not exist, the {@link Parameter} does not exist on + * the {@link ParameterBag}, or the value of the parameter is empty + */ + boolean isRelationSet(String paramKey); + /** * Returns true if the {@link Parameter} with the given paramKey exists on the {@link ParameterBag} with the given * bagKey