[New] Added GroupedParameterizedElement.removeRelation()

This commit is contained in:
Robert von Burg 2021-03-31 17:40:01 +02:00
parent d61365f0ff
commit 32662678e7
2 changed files with 24 additions and 0 deletions

View File

@ -829,6 +829,19 @@ public abstract class GroupedParameterizedElement extends AbstractStrolchElement
return bag.removeParameter(paramKey);
}
@Override
public <U, T extends Parameter<U>> T removeRelation(String paramKey) {
assertNotReadonly();
if (this.parameterBagMap == null)
return null;
ParameterBag bag = this.parameterBagMap.get(BAG_RELATIONS);
if (bag == null) {
return null;
}
return bag.removeParameter(paramKey);
}
@Override
public <U, T extends Parameter<U>> T removeParameter(String bagKey, String paramKey) {
assertNotReadonly();

View File

@ -1491,6 +1491,17 @@ public interface ParameterBagContainer extends StrolchElement {
*/
<U, T extends Parameter<U>> T removeParameter(String paramKey);
/**
* Removes the {@link Parameter} with the given paramKey from the {@link ParameterBag} with the key {@link
* StrolchModelConstants#BAG_RELATIONS}
*
* @param paramKey
* the key of the {@link Parameter} which is to be removed
*
* @return the removed {@link Parameter} or null if it did not exist
*/
<U, T extends Parameter<U>> T removeRelation(String paramKey);
/**
* Removes the {@link Parameter} with the given paramKey from the {@link ParameterBag} with the given bagKey
*