[New] Added ParameterizedElement.copyParameterValue() and .copyRelationId()
This commit is contained in:
parent
9306648f4d
commit
8976dd950b
|
@ -26,13 +26,15 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if the parameter with the given key on the {@link ParameterBag} with the id
|
* Returns true if the parameter with the given key on the {@link ParameterBag} with the id
|
||||||
* {@link StrolchModelConstants#BAG_PARAMETERS} does not exist or the value is empty, i.e. {@link Parameter#isEmpty()} returns true
|
* {@link StrolchModelConstants#BAG_PARAMETERS} does not exist or the value is empty, i.e.
|
||||||
|
* {@link Parameter#isEmpty()} returns true
|
||||||
*
|
*
|
||||||
* @param paramKey
|
* @param paramKey
|
||||||
* the parameter to check if it is empty
|
* the parameter to check if it is empty
|
||||||
*
|
*
|
||||||
* @return true if the parameter with the given key on the {@link ParameterBag} with the id
|
* @return true if the parameter with the given key on the {@link ParameterBag} with the id
|
||||||
* {@link StrolchModelConstants#BAG_PARAMETERS} does not exist or the value is empty, i.e. {@link Parameter#isEmpty()} returns true
|
* {@link StrolchModelConstants#BAG_PARAMETERS} does not exist or the value is empty, i.e.
|
||||||
|
* {@link Parameter#isEmpty()} returns true
|
||||||
*/
|
*/
|
||||||
default boolean isParamEmpty(String paramKey) {
|
default boolean isParamEmpty(String paramKey) {
|
||||||
return !this.hasParameter(paramKey) || getParameter(paramKey).isEmpty();
|
return !this.hasParameter(paramKey) || getParameter(paramKey).isEmpty();
|
||||||
|
@ -40,7 +42,8 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if the parameter with the given key on the {@link ParameterBag} with the id
|
* Returns true if the parameter with the given key on the {@link ParameterBag} with the id
|
||||||
* {@link StrolchModelConstants#BAG_PARAMETERS} does not exist or the value is empty, i.e. {@link Parameter#isEmpty()} returns true
|
* {@link StrolchModelConstants#BAG_PARAMETERS} does not exist or the value is empty, i.e.
|
||||||
|
* {@link Parameter#isEmpty()} returns true
|
||||||
*
|
*
|
||||||
* @param bagKey
|
* @param bagKey
|
||||||
* the key from which {@link ParameterBag} to get the parameter
|
* the key from which {@link ParameterBag} to get the parameter
|
||||||
|
@ -48,7 +51,8 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
* the parameter to check if it is empty
|
* the parameter to check if it is empty
|
||||||
*
|
*
|
||||||
* @return true if the parameter with the given key on the {@link ParameterBag} with the id
|
* @return true if the parameter with the given key on the {@link ParameterBag} with the id
|
||||||
* {@link StrolchModelConstants#BAG_PARAMETERS} does not exist or the value is empty, i.e. {@link Parameter#isEmpty()} returns true
|
* {@link StrolchModelConstants#BAG_PARAMETERS} does not exist or the value is empty, i.e.
|
||||||
|
* {@link Parameter#isEmpty()} returns true
|
||||||
*/
|
*/
|
||||||
default boolean isParamEmpty(String bagKey, String paramKey) {
|
default boolean isParamEmpty(String bagKey, String paramKey) {
|
||||||
return !this.hasParameter(bagKey, paramKey) || getParameter(bagKey, paramKey).isEmpty();
|
return !this.hasParameter(bagKey, paramKey) || getParameter(bagKey, paramKey).isEmpty();
|
||||||
|
@ -56,13 +60,15 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if the parameter with the given key on the {@link ParameterBag} with the id
|
* Returns true if the parameter with the given key on the {@link ParameterBag} with the id
|
||||||
* {@link StrolchModelConstants#BAG_PARAMETERS} exists and the value is not empty, i.e. {@link Parameter#isSet()} returns true
|
* {@link StrolchModelConstants#BAG_PARAMETERS} exists and the value is not empty, i.e. {@link Parameter#isSet()}
|
||||||
|
* returns true
|
||||||
*
|
*
|
||||||
* @param paramKey
|
* @param paramKey
|
||||||
* the parameter to check if it has a value
|
* the parameter to check if it has a value
|
||||||
*
|
*
|
||||||
* @return true if the parameter with the given key on the {@link ParameterBag} with the id
|
* @return true if the parameter with the given key on the {@link ParameterBag} with the id
|
||||||
* {@link StrolchModelConstants#BAG_PARAMETERS} exists and the value is not empty, i.e. {@link Parameter#isSet()} returns true
|
* {@link StrolchModelConstants#BAG_PARAMETERS} exists and the value is not empty, i.e. {@link Parameter#isSet()}
|
||||||
|
* returns true
|
||||||
*/
|
*/
|
||||||
default boolean isParamSet(String paramKey) {
|
default boolean isParamSet(String paramKey) {
|
||||||
return this.hasParameter(paramKey) && getParameter(paramKey).isSet();
|
return this.hasParameter(paramKey) && getParameter(paramKey).isSet();
|
||||||
|
@ -70,7 +76,8 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if the parameter with the given key on the {@link ParameterBag} with the id
|
* Returns true if the parameter with the given key on the {@link ParameterBag} with the id
|
||||||
* {@link StrolchModelConstants#BAG_PARAMETERS} exists and the value is not empty, i.e. {@link Parameter#isSet()} returns true
|
* {@link StrolchModelConstants#BAG_PARAMETERS} exists and the value is not empty, i.e. {@link Parameter#isSet()}
|
||||||
|
* returns true
|
||||||
*
|
*
|
||||||
* @param bagKey
|
* @param bagKey
|
||||||
* the key from which {@link ParameterBag} to get the parameter
|
* the key from which {@link ParameterBag} to get the parameter
|
||||||
|
@ -78,7 +85,8 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
* the parameter to check if it has a value
|
* the parameter to check if it has a value
|
||||||
*
|
*
|
||||||
* @return true if the parameter with the given key on the {@link ParameterBag} with the id
|
* @return true if the parameter with the given key on the {@link ParameterBag} with the id
|
||||||
* {@link StrolchModelConstants#BAG_PARAMETERS} exists and the value is not empty, i.e. {@link Parameter#isSet()} returns true
|
* {@link StrolchModelConstants#BAG_PARAMETERS} exists and the value is not empty, i.e. {@link Parameter#isSet()}
|
||||||
|
* returns true
|
||||||
*/
|
*/
|
||||||
default boolean isParamSet(String bagKey, String paramKey) {
|
default boolean isParamSet(String bagKey, String paramKey) {
|
||||||
return this.hasParameter(bagKey, paramKey) && getParameter(bagKey, paramKey).isSet();
|
return this.hasParameter(bagKey, paramKey) && getParameter(bagKey, paramKey).isSet();
|
||||||
|
@ -553,9 +561,11 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Returns the default {@link ParameterBag}, i.e. the bag with the ID {@link StrolchModelConstants#BAG_PARAMETERS}</p>
|
* <p>Returns the default {@link ParameterBag}, i.e. the bag with the ID
|
||||||
|
* {@link StrolchModelConstants#BAG_PARAMETERS}</p>
|
||||||
*
|
*
|
||||||
* <p><b>Note:</b> If the bag does not exist, it is created, and added to this container. Thus this element must not be read-only!</p>
|
* <p><b>Note:</b> If the bag does not exist, it is created, and added to this container. Thus this element must
|
||||||
|
* not be read-only!</p>
|
||||||
*
|
*
|
||||||
* @return the default {@link ParameterBag}, i.e. the bag with the ID {@link StrolchModelConstants#BAG_PARAMETERS}
|
* @return the default {@link ParameterBag}, i.e. the bag with the ID {@link StrolchModelConstants#BAG_PARAMETERS}
|
||||||
*/
|
*/
|
||||||
|
@ -569,9 +579,11 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Returns the relations {@link ParameterBag}, i.e. the bag with the ID {@link StrolchModelConstants#BAG_RELATIONS}</p>
|
* <p>Returns the relations {@link ParameterBag}, i.e. the bag with the ID
|
||||||
|
* {@link StrolchModelConstants#BAG_RELATIONS}</p>
|
||||||
*
|
*
|
||||||
* <p><b>Note:</b> If the bag does not exist, it is created, and added to this container. Thus this element must not be read-only!</p>
|
* <p><b>Note:</b> If the bag does not exist, it is created, and added to this container. Thus this element must
|
||||||
|
* not be read-only!</p>
|
||||||
*
|
*
|
||||||
* @return the relations {@link ParameterBag}, i.e. the bag with the ID {@link StrolchModelConstants#BAG_RELATIONS}
|
* @return the relations {@link ParameterBag}, i.e. the bag with the ID {@link StrolchModelConstants#BAG_RELATIONS}
|
||||||
*/
|
*/
|
||||||
|
@ -601,8 +613,8 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the given enum's name value on the {@link StringParameter} with the given paramKey on the {@link
|
* Sets the given enum's name value on the {@link StringParameter} with the given paramKey on the
|
||||||
* ParameterBag} with the ID {@link StrolchModelConstants#BAG_PARAMETERS}
|
* {@link ParameterBag} with the ID {@link StrolchModelConstants#BAG_PARAMETERS}
|
||||||
*
|
*
|
||||||
* @param paramKey
|
* @param paramKey
|
||||||
* the key of the parameter for which to return the value
|
* the key of the parameter for which to return the value
|
||||||
|
@ -636,8 +648,8 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the given enum's name value on the {@link StringParameter} with the given paramKey on the {@link
|
* Sets the given enum's name value on the {@link StringParameter} with the given paramKey on the
|
||||||
* ParameterBag} with the given bagKey
|
* {@link ParameterBag} with the given bagKey
|
||||||
*
|
*
|
||||||
* @param bagKey
|
* @param bagKey
|
||||||
* the key from which {@link ParameterBag} to get the parameter
|
* the key from which {@link ParameterBag} to get the parameter
|
||||||
|
@ -1147,8 +1159,8 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the {@link StringParameter} with the given paramKey from the {@link ParameterBag} with the ID {@link
|
* Returns the {@link StringParameter} with the given paramKey from the {@link ParameterBag} with the ID
|
||||||
* StrolchModelConstants#BAG_PARAMETERS}
|
* {@link StrolchModelConstants#BAG_PARAMETERS}
|
||||||
*
|
*
|
||||||
* @param paramKey
|
* @param paramKey
|
||||||
* the key of the parameter
|
* the key of the parameter
|
||||||
|
@ -1182,8 +1194,8 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the {@link BooleanParameter} with the given paramKey from the {@link ParameterBag} with the ID {@link
|
* Returns the {@link BooleanParameter} with the given paramKey from the {@link ParameterBag} with the ID
|
||||||
* StrolchModelConstants#BAG_PARAMETERS}
|
* {@link StrolchModelConstants#BAG_PARAMETERS}
|
||||||
*
|
*
|
||||||
* @param paramKey
|
* @param paramKey
|
||||||
* the key of the parameter
|
* the key of the parameter
|
||||||
|
@ -1217,8 +1229,8 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the {@link IntegerParameter} with the given paramKey from the {@link ParameterBag} with the ID {@link
|
* Returns the {@link IntegerParameter} with the given paramKey from the {@link ParameterBag} with the ID
|
||||||
* StrolchModelConstants#BAG_PARAMETERS}
|
* {@link StrolchModelConstants#BAG_PARAMETERS}
|
||||||
*
|
*
|
||||||
* @param paramKey
|
* @param paramKey
|
||||||
* the key of the parameter
|
* the key of the parameter
|
||||||
|
@ -1252,8 +1264,8 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the {@link FloatParameter} with the given paramKey from the {@link ParameterBag} with the ID {@link
|
* Returns the {@link FloatParameter} with the given paramKey from the {@link ParameterBag} with the ID
|
||||||
* StrolchModelConstants#BAG_PARAMETERS}
|
* {@link StrolchModelConstants#BAG_PARAMETERS}
|
||||||
*
|
*
|
||||||
* @param paramKey
|
* @param paramKey
|
||||||
* the key of the parameter
|
* the key of the parameter
|
||||||
|
@ -1287,8 +1299,8 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the {@link LongParameter} with the given paramKey from the {@link ParameterBag} with the ID {@link
|
* Returns the {@link LongParameter} with the given paramKey from the {@link ParameterBag} with the ID
|
||||||
* StrolchModelConstants#BAG_PARAMETERS}
|
* {@link StrolchModelConstants#BAG_PARAMETERS}
|
||||||
*
|
*
|
||||||
* @param paramKey
|
* @param paramKey
|
||||||
* the key of the parameter
|
* the key of the parameter
|
||||||
|
@ -1322,8 +1334,8 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the {@link DateParameter} with the given paramKey from the {@link ParameterBag} with the ID {@link
|
* Returns the {@link DateParameter} with the given paramKey from the {@link ParameterBag} with the ID
|
||||||
* StrolchModelConstants#BAG_PARAMETERS}
|
* {@link StrolchModelConstants#BAG_PARAMETERS}
|
||||||
*
|
*
|
||||||
* @param paramKey
|
* @param paramKey
|
||||||
* the key of the parameter
|
* the key of the parameter
|
||||||
|
@ -1357,8 +1369,8 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the {@link TextParameter} with the given paramKey from the {@link ParameterBag} with the ID {@link
|
* Returns the {@link TextParameter} with the given paramKey from the {@link ParameterBag} with the ID
|
||||||
* StrolchModelConstants#BAG_PARAMETERS}
|
* {@link StrolchModelConstants#BAG_PARAMETERS}
|
||||||
*
|
*
|
||||||
* @param paramKey
|
* @param paramKey
|
||||||
* the key of the parameter
|
* the key of the parameter
|
||||||
|
@ -1392,8 +1404,8 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the {@link DurationParameter} with the given paramKey from the {@link ParameterBag} with the ID {@link
|
* Returns the {@link DurationParameter} with the given paramKey from the {@link ParameterBag} with the ID
|
||||||
* StrolchModelConstants#BAG_PARAMETERS}
|
* {@link StrolchModelConstants#BAG_PARAMETERS}
|
||||||
*
|
*
|
||||||
* @param paramKey
|
* @param paramKey
|
||||||
* the key of the parameter
|
* the key of the parameter
|
||||||
|
@ -1428,8 +1440,8 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the {@link StringListParameter} with the given paramKey from the {@link ParameterBag} with the ID {@link
|
* Returns the {@link StringListParameter} with the given paramKey from the {@link ParameterBag} with the ID
|
||||||
* StrolchModelConstants#BAG_PARAMETERS}
|
* {@link StrolchModelConstants#BAG_PARAMETERS}
|
||||||
*
|
*
|
||||||
* @param paramKey
|
* @param paramKey
|
||||||
* the key of the parameter
|
* the key of the parameter
|
||||||
|
@ -1464,8 +1476,8 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the {@link IntegerListParameter} with the given paramKey from the {@link ParameterBag} with the ID {@link
|
* Returns the {@link IntegerListParameter} with the given paramKey from the {@link ParameterBag} with the ID
|
||||||
* StrolchModelConstants#BAG_PARAMETERS}
|
* {@link StrolchModelConstants#BAG_PARAMETERS}
|
||||||
*
|
*
|
||||||
* @param paramKey
|
* @param paramKey
|
||||||
* the key of the parameter
|
* the key of the parameter
|
||||||
|
@ -1500,8 +1512,8 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the {@link FloatListParameter} with the given paramKey from the {@link ParameterBag} with the ID {@link
|
* Returns the {@link FloatListParameter} with the given paramKey from the {@link ParameterBag} with the ID
|
||||||
* StrolchModelConstants#BAG_PARAMETERS}
|
* {@link StrolchModelConstants#BAG_PARAMETERS}
|
||||||
*
|
*
|
||||||
* @param paramKey
|
* @param paramKey
|
||||||
* the key of the parameter
|
* the key of the parameter
|
||||||
|
@ -1536,8 +1548,8 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the {@link LongListParameter} with the given paramKey from the {@link ParameterBag} with the ID {@link
|
* Returns the {@link LongListParameter} with the given paramKey from the {@link ParameterBag} with the ID
|
||||||
* StrolchModelConstants#BAG_PARAMETERS}
|
* {@link StrolchModelConstants#BAG_PARAMETERS}
|
||||||
*
|
*
|
||||||
* @param paramKey
|
* @param paramKey
|
||||||
* the key of the parameter
|
* the key of the parameter
|
||||||
|
@ -1572,9 +1584,9 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the {@link Parameter} with the given key from the {@link ParameterBag} with the ID {@link *
|
* Returns the {@link Parameter} with the given key from the {@link ParameterBag} with the ID
|
||||||
* StrolchModelConstants#BAG_PARAMETERS}, or null if the {@link Parameter} or the {@link ParameterBag} does not
|
* {@link * StrolchModelConstants#BAG_PARAMETERS}, or null if the {@link Parameter} or the {@link ParameterBag} does
|
||||||
* exist
|
* not exist
|
||||||
*
|
*
|
||||||
* @param paramKey
|
* @param paramKey
|
||||||
* the key of the {@link Parameter} which is to be returned
|
* the key of the {@link Parameter} which is to be returned
|
||||||
|
@ -1584,9 +1596,9 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
<U, T extends Parameter<U>> T getParameter(String paramKey);
|
<U, T extends Parameter<U>> T getParameter(String paramKey);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the {@link Parameter} with the given key from the {@link ParameterBag} with the ID {@link
|
* Returns the {@link Parameter} with the given key from the {@link ParameterBag} with the ID
|
||||||
* StrolchModelConstants#BAG_PARAMETERS}, or null if the {@link Parameter} or the {@link ParameterBag} does not
|
* {@link StrolchModelConstants#BAG_PARAMETERS}, or null if the {@link Parameter} or the {@link ParameterBag} does
|
||||||
* exist
|
* not exist
|
||||||
*
|
*
|
||||||
* @param paramKey
|
* @param paramKey
|
||||||
* the key of the {@link Parameter} which is to be returned
|
* the key of the {@link Parameter} which is to be returned
|
||||||
|
@ -1638,9 +1650,9 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a stream over the values of the {@link StringListParameter} with the given key from the {@link
|
* Returns a stream over the values of the {@link StringListParameter} with the given key from the
|
||||||
* ParameterBag} with the ID {@link StrolchModelConstants#BAG_RELATIONS}, if the {@link Parameter} or the {@link
|
* {@link ParameterBag} with the ID {@link StrolchModelConstants#BAG_RELATIONS}, if the {@link Parameter} or the
|
||||||
* ParameterBag} does not exist, then a {@link StrolchModelException} is thrown
|
* {@link ParameterBag} does not exist, then a {@link StrolchModelException} is thrown
|
||||||
*
|
*
|
||||||
* @param paramKey
|
* @param paramKey
|
||||||
* the key of the {@link StringParameter} for which the value is to be returned
|
* the key of the {@link StringParameter} for which the value is to be returned
|
||||||
|
@ -1658,9 +1670,9 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the value of the {@link StringParameter} with the given key on the {@link ParameterBag} with the ID {@link
|
* Sets the value of the {@link StringParameter} with the given key on the {@link ParameterBag} with the ID
|
||||||
* StrolchModelConstants#BAG_RELATIONS}, if the {@link Parameter} or the {@link ParameterBag} does not exist, then a
|
* {@link StrolchModelConstants#BAG_RELATIONS}, if the {@link Parameter} or the {@link ParameterBag} does not exist,
|
||||||
* {@link StrolchModelException} is thrown
|
* then a {@link StrolchModelException} is thrown
|
||||||
*
|
*
|
||||||
* @param paramKey
|
* @param paramKey
|
||||||
* the key of the {@link StringParameter} for which the value is to be returned
|
* the key of the {@link StringParameter} for which the value is to be returned
|
||||||
|
@ -1692,9 +1704,9 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the {@link StringParameter} with the given key from the {@link ParameterBag} with the ID {@link
|
* Returns the {@link StringParameter} with the given key from the {@link ParameterBag} with the ID
|
||||||
* StrolchModelConstants#BAG_RELATIONS}, if the {@link Parameter} or the {@link ParameterBag} does not exist, then a
|
* {@link StrolchModelConstants#BAG_RELATIONS}, if the {@link Parameter} or the {@link ParameterBag} does not exist,
|
||||||
* {@link StrolchModelException} is thrown
|
* then a {@link StrolchModelException} is thrown
|
||||||
*
|
*
|
||||||
* @param paramKey
|
* @param paramKey
|
||||||
* the key of the {@link Parameter} which is to be returned
|
* the key of the {@link Parameter} which is to be returned
|
||||||
|
@ -1709,9 +1721,9 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the {@link StringParameter} with the given key from the {@link ParameterBag} with the ID {@link
|
* Returns the {@link StringParameter} with the given key from the {@link ParameterBag} with the ID
|
||||||
* StrolchModelConstants#BAG_RELATIONS}, or null if the {@link Parameter} or the {@link ParameterBag} does not
|
* {@link StrolchModelConstants#BAG_RELATIONS}, or null if the {@link Parameter} or the {@link ParameterBag} does
|
||||||
* exist
|
* not exist
|
||||||
*
|
*
|
||||||
* @param paramKey
|
* @param paramKey
|
||||||
* the key of the {@link Parameter} which is to be returned
|
* the key of the {@link Parameter} which is to be returned
|
||||||
|
@ -1723,9 +1735,9 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the {@link StringParameter} with the given key from the {@link ParameterBag} with the ID {@link
|
* Returns the {@link StringParameter} with the given key from the {@link ParameterBag} with the ID
|
||||||
* StrolchModelConstants#BAG_RELATIONS}, or null if the {@link Parameter} or the {@link ParameterBag} does not
|
* {@link StrolchModelConstants#BAG_RELATIONS}, or null if the {@link Parameter} or the {@link ParameterBag} does
|
||||||
* exist
|
* not exist
|
||||||
*
|
*
|
||||||
* @param paramKey
|
* @param paramKey
|
||||||
* the key of the {@link Parameter} which is to be returned
|
* the key of the {@link Parameter} which is to be returned
|
||||||
|
@ -1739,9 +1751,9 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the {@link StringListParameter} with the given key from the {@link ParameterBag} with the ID {@link
|
* Returns the {@link StringListParameter} with the given key from the {@link ParameterBag} with the ID
|
||||||
* StrolchModelConstants#BAG_RELATIONS}, or null if the {@link Parameter} or the {@link ParameterBag} does not
|
* {@link StrolchModelConstants#BAG_RELATIONS}, or null if the {@link Parameter} or the {@link ParameterBag} does
|
||||||
* exist
|
* not exist
|
||||||
*
|
*
|
||||||
* @param paramKey
|
* @param paramKey
|
||||||
* the key of the {@link Parameter} which is to be returned
|
* the key of the {@link Parameter} which is to be returned
|
||||||
|
@ -1753,9 +1765,9 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the {@link StringListParameter} with the given key from the {@link ParameterBag} with the ID {@link
|
* Returns the {@link StringListParameter} with the given key from the {@link ParameterBag} with the ID
|
||||||
* StrolchModelConstants#BAG_RELATIONS}, if the {@link Parameter} or the {@link ParameterBag} does not exist, then a
|
* {@link StrolchModelConstants#BAG_RELATIONS}, if the {@link Parameter} or the {@link ParameterBag} does not exist,
|
||||||
* {@link StrolchModelException} is thrown
|
* then a {@link StrolchModelException} is thrown
|
||||||
*
|
*
|
||||||
* @param paramKey
|
* @param paramKey
|
||||||
* the key of the {@link Parameter} which is to be returned
|
* the key of the {@link Parameter} which is to be returned
|
||||||
|
@ -1770,9 +1782,9 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the {@link StringListParameter} with the given key from the {@link ParameterBag} with the ID {@link
|
* Returns the {@link StringListParameter} with the given key from the {@link ParameterBag} with the ID
|
||||||
* StrolchModelConstants#BAG_RELATIONS}, or null if the {@link Parameter} or the {@link ParameterBag} does not
|
* {@link StrolchModelConstants#BAG_RELATIONS}, or null if the {@link Parameter} or the {@link ParameterBag} does
|
||||||
* exist
|
* not exist
|
||||||
*
|
*
|
||||||
* @param paramKey
|
* @param paramKey
|
||||||
* the key of the {@link Parameter} which is to be returned
|
* the key of the {@link Parameter} which is to be returned
|
||||||
|
@ -1896,8 +1908,8 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a new {@link Parameter} to the {@link ParameterBag} with the given key {@link
|
* Adds a new {@link Parameter} to the {@link ParameterBag} with the given key
|
||||||
* StrolchModelConstants#BAG_PARAMETERS}
|
* {@link StrolchModelConstants#BAG_PARAMETERS}
|
||||||
*
|
*
|
||||||
* @param parameter
|
* @param parameter
|
||||||
* the {@link Parameter} to be added to the {@link ParameterBag}
|
* the {@link Parameter} to be added to the {@link ParameterBag}
|
||||||
|
@ -1921,8 +1933,8 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
void addParameter(String bagKey, Parameter<?> parameter) throws StrolchException;
|
void addParameter(String bagKey, Parameter<?> parameter) throws StrolchException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes the {@link Parameter} with the given paramKey from the {@link ParameterBag} with the key {@link
|
* Removes the {@link Parameter} with the given paramKey from the {@link ParameterBag} with the key
|
||||||
* StrolchModelConstants#BAG_PARAMETERS}
|
* {@link StrolchModelConstants#BAG_PARAMETERS}
|
||||||
*
|
*
|
||||||
* @param paramKey
|
* @param paramKey
|
||||||
* the key of the {@link Parameter} which is to be removed
|
* the key of the {@link Parameter} which is to be removed
|
||||||
|
@ -1932,8 +1944,8 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
<U, T extends Parameter<U>> T removeParameter(String paramKey);
|
<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
|
* Removes the {@link Parameter} with the given paramKey from the {@link ParameterBag} with the key
|
||||||
* StrolchModelConstants#BAG_RELATIONS}
|
* {@link StrolchModelConstants#BAG_RELATIONS}
|
||||||
*
|
*
|
||||||
* @param paramKey
|
* @param paramKey
|
||||||
* the key of the {@link Parameter} which is to be removed
|
* the key of the {@link Parameter} which is to be removed
|
||||||
|
@ -2078,8 +2090,9 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
* the key of the {@link Parameter} to be found
|
* 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
|
* @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
|
* bagKey and the value of the parameter is also set, i.e. not empty. False is returned if the {@link ParameterBag}
|
||||||
* the {@link ParameterBag}, or the value of the parameter is empty
|
* does not exist, the {@link Parameter} does not exist on the {@link ParameterBag}, or the value of the parameter
|
||||||
|
* is empty
|
||||||
*/
|
*/
|
||||||
default boolean isRelationSet(String paramKey) {
|
default boolean isRelationSet(String paramKey) {
|
||||||
StringParameter relationP = getParameter(BAG_RELATIONS, paramKey);
|
StringParameter relationP = getParameter(BAG_RELATIONS, paramKey);
|
||||||
|
@ -2087,14 +2100,14 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if the {@link Parameter} with the given paramKey does not exist on the {@link ParameterBag} with the id
|
* Returns true if the {@link Parameter} with the given paramKey does not exist on the {@link ParameterBag} with the
|
||||||
* {@link StrolchModelConstants#BAG_RELATIONS} or if the value of the parameter is empty
|
* id {@link StrolchModelConstants#BAG_RELATIONS} or if the value of the parameter is empty
|
||||||
*
|
*
|
||||||
* @param paramKey
|
* @param paramKey
|
||||||
* the key of the {@link Parameter} to be found
|
* the key of the {@link Parameter} to be found
|
||||||
*
|
*
|
||||||
* @return true if the {@link Parameter} with the given paramKey does not exist on the {@link ParameterBag} with the id
|
* @return true if the {@link Parameter} with the given paramKey does not exist on the {@link ParameterBag} with the
|
||||||
* {@link StrolchModelConstants#BAG_RELATIONS} or if the value of the parameter is empty
|
* id {@link StrolchModelConstants#BAG_RELATIONS} or if the value of the parameter is empty
|
||||||
*/
|
*/
|
||||||
default boolean isRelationEmpty(String paramKey) {
|
default boolean isRelationEmpty(String paramKey) {
|
||||||
StringParameter relationP = getParameter(BAG_RELATIONS, paramKey);
|
StringParameter relationP = getParameter(BAG_RELATIONS, paramKey);
|
||||||
|
@ -2122,4 +2135,88 @@ public interface ParameterBagContainer extends StrolchElement {
|
||||||
* @return the {@link Set} of keys for the {@link ParameterBag}s on this {@link GroupedParameterizedElement}
|
* @return the {@link Set} of keys for the {@link ParameterBag}s on this {@link GroupedParameterizedElement}
|
||||||
*/
|
*/
|
||||||
Set<String> getParameterBagKeySet();
|
Set<String> getParameterBagKeySet();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copies the value of the parameter with the given id from the given element and sets it on the parameter on this
|
||||||
|
* element. Copying is done from the #BAG_PARAMETERS parameter bag
|
||||||
|
*
|
||||||
|
* @param paramId
|
||||||
|
* the id of the parameter to fetch from the {@link ParameterBag} with the id #BAG_PARAMETERS
|
||||||
|
* @param otherElement
|
||||||
|
* the element from which to get the parameter
|
||||||
|
*/
|
||||||
|
default void copyParameterValue(String paramId, ParameterizedElement otherElement) {
|
||||||
|
copyParameterValue(BAG_PARAMETERS, paramId, otherElement);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copies the value of the parameter with the given id from the given element and sets it on the parameter on this
|
||||||
|
* element. Copying is done from the #BAG_RELATIONS parameter bag
|
||||||
|
*
|
||||||
|
* @param paramId
|
||||||
|
* the id of the parameter to fetch from the {@link ParameterBag} with the id #BAG_PARAMETERS
|
||||||
|
* @param otherElement
|
||||||
|
* the element from which to get the parameter
|
||||||
|
*/
|
||||||
|
default void copyRelationId(String paramId, ParameterizedElement otherElement) {
|
||||||
|
copyParameterValue(BAG_RELATIONS, paramId, otherElement);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copies the value of the parameter with the given id from the given element and sets it on the parameter on this
|
||||||
|
* element
|
||||||
|
*
|
||||||
|
* @param bagId
|
||||||
|
* the id of the bag from which to fetch the parameter
|
||||||
|
* @param paramId
|
||||||
|
* the id of the parameter to use
|
||||||
|
* @param otherElement
|
||||||
|
* the element from which to fetch the parameter
|
||||||
|
*/
|
||||||
|
default void copyParameterValue(String bagId, String paramId, ParameterizedElement otherElement) {
|
||||||
|
Parameter<?> otherParam = otherElement.getParameter(paramId);
|
||||||
|
getParameter(bagId, paramId, true).setValue(otherParam.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copies the value of the parameter with the given id from the given element and sets it on the parameter on this
|
||||||
|
* element. Copying is done from the #BAG_PARAMETERS parameter bag
|
||||||
|
*
|
||||||
|
* @param paramId
|
||||||
|
* the id of the parameter to use
|
||||||
|
* @param otherElement
|
||||||
|
* the element from which to fetch the parameter
|
||||||
|
*/
|
||||||
|
default void copyParameterValue(String paramId, ParameterBagContainer otherElement) {
|
||||||
|
copyParameterValue(BAG_PARAMETERS, paramId, otherElement);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copies the value of the parameter with the given id from the given element and sets it on the parameter on this
|
||||||
|
* element. Copying is done from the #BAG_RELATIONS parameter bag
|
||||||
|
*
|
||||||
|
* @param paramId
|
||||||
|
* the id of the parameter to use
|
||||||
|
* @param otherElement
|
||||||
|
* the element from which to fetch the parameter
|
||||||
|
*/
|
||||||
|
default void copyRelationId(String paramId, ParameterBagContainer otherElement) {
|
||||||
|
copyParameterValue(BAG_RELATIONS, paramId, otherElement);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copies the value of the parameter with the given id from the given element and sets it on the parameter on this
|
||||||
|
* element
|
||||||
|
*
|
||||||
|
* @param bagId
|
||||||
|
* the id of the bag from which to fetch the parameter
|
||||||
|
* @param paramId
|
||||||
|
* the id of the parameter to use
|
||||||
|
* @param otherElement
|
||||||
|
* the element from which to fetch the parameter
|
||||||
|
*/
|
||||||
|
default void copyParameterValue(String bagId, String paramId, ParameterBagContainer otherElement) {
|
||||||
|
Parameter<?> otherParam = otherElement.getParameter(bagId, paramId);
|
||||||
|
getParameter(bagId, paramId, true).setValue(otherParam.getValue());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,8 +17,7 @@ package li.strolch.model;
|
||||||
|
|
||||||
import static java.util.stream.Collectors.toList;
|
import static java.util.stream.Collectors.toList;
|
||||||
import static java.util.stream.Collectors.toMap;
|
import static java.util.stream.Collectors.toMap;
|
||||||
import static li.strolch.model.StrolchModelConstants.INTERPRETATION_NONE;
|
import static li.strolch.model.StrolchModelConstants.*;
|
||||||
import static li.strolch.model.StrolchModelConstants.UOM_NONE;
|
|
||||||
import static li.strolch.model.builder.BuilderHelper.buildParamName;
|
import static li.strolch.model.builder.BuilderHelper.buildParamName;
|
||||||
import static li.strolch.utils.helper.StringHelper.isEmpty;
|
import static li.strolch.utils.helper.StringHelper.isEmpty;
|
||||||
|
|
||||||
|
@ -97,24 +96,28 @@ public abstract class ParameterizedElement extends AbstractStrolchElement {
|
||||||
///
|
///
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if the parameter with the given key does not exist or the value is empty, i.e. {@link Parameter#isEmpty()} returns true
|
* Returns true if the parameter with the given key does not exist or the value is empty, i.e.
|
||||||
|
* {@link Parameter#isEmpty()} returns true
|
||||||
*
|
*
|
||||||
* @param paramKey
|
* @param paramKey
|
||||||
* the parameter to check if it is empty
|
* the parameter to check if it is empty
|
||||||
*
|
*
|
||||||
* @return true if the parameter with the given key does not exist or the value is empty, i.e. {@link Parameter#isEmpty()} returns true
|
* @return true if the parameter with the given key does not exist or the value is empty, i.e.
|
||||||
|
* {@link Parameter#isEmpty()} returns true
|
||||||
*/
|
*/
|
||||||
public boolean isParamEmpty(String paramKey) {
|
public boolean isParamEmpty(String paramKey) {
|
||||||
return !this.hasParameter(paramKey) || getParameter(paramKey).isEmpty();
|
return !this.hasParameter(paramKey) || getParameter(paramKey).isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if the parameter with the given key exists and the value is not empty, i.e. {@link Parameter#isSet()} returns true
|
* Returns true if the parameter with the given key exists and the value is not empty, i.e.
|
||||||
|
* {@link Parameter#isSet()} returns true
|
||||||
*
|
*
|
||||||
* @param paramKey
|
* @param paramKey
|
||||||
* the parameter to check if it has a value
|
* the parameter to check if it has a value
|
||||||
*
|
*
|
||||||
* @return true if the parameter with the given key exists and the value is not empty, i.e. {@link Parameter#isSet()} returns true
|
* @return true if the parameter with the given key exists and the value is not empty, i.e.
|
||||||
|
* {@link Parameter#isSet()} returns true
|
||||||
*/
|
*/
|
||||||
public boolean isParamSet(String paramKey) {
|
public boolean isParamSet(String paramKey) {
|
||||||
return this.hasParameter(paramKey) && getParameter(paramKey).isSet();
|
return this.hasParameter(paramKey) && getParameter(paramKey).isSet();
|
||||||
|
@ -1111,6 +1114,62 @@ public abstract class ParameterizedElement extends AbstractStrolchElement {
|
||||||
param.accept(new SetParameterValueFromJsonVisitor(jsonObject, ignoreOnEmpty));
|
param.accept(new SetParameterValueFromJsonVisitor(jsonObject, ignoreOnEmpty));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copies the value of the parameter with the given id from the given element and sets it on the parameter on this
|
||||||
|
* element
|
||||||
|
*
|
||||||
|
* @param paramId
|
||||||
|
* the parameter ID of which to copy the value
|
||||||
|
* @param otherElement
|
||||||
|
* the element from which to get the value to copy
|
||||||
|
*/
|
||||||
|
public void copyParameterValue(String paramId, ParameterizedElement otherElement) {
|
||||||
|
Parameter<?> otherParam = otherElement.getParameter(paramId);
|
||||||
|
getParameter(paramId, true).setValue(otherParam.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copies the value of the parameter with the given id from the given element and sets it on the parameter on this
|
||||||
|
* element. Copying is done from the #BAG_PARAMETERS parameter bag
|
||||||
|
*
|
||||||
|
* @param paramId
|
||||||
|
* the parameter ID of which to copy the value
|
||||||
|
* @param otherElement
|
||||||
|
* the element from which to get the value to copy
|
||||||
|
*/
|
||||||
|
public void copyParameterValue(String paramId, GroupedParameterizedElement otherElement) {
|
||||||
|
copyParameterValue(BAG_PARAMETERS, paramId, otherElement);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copies the value of the parameter with the given id from the given element and sets it on the parameter on this
|
||||||
|
* element. Copying is done from the #BAG_RELATIONS parameter bag
|
||||||
|
*
|
||||||
|
* @param paramId
|
||||||
|
* the parameter ID of which to copy the value
|
||||||
|
* @param otherElement
|
||||||
|
* the element from which to get the value to copy
|
||||||
|
*/
|
||||||
|
public void copyRelationId(String paramId, GroupedParameterizedElement otherElement) {
|
||||||
|
copyParameterValue(BAG_RELATIONS, paramId, otherElement);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copies the value of the parameter from the {@link ParameterBag} with the given bag and param ID from the given
|
||||||
|
* element and sets it on the parameter on this element
|
||||||
|
*
|
||||||
|
* @param bagId
|
||||||
|
* the ID of the bag from which to get the parameter from the other element
|
||||||
|
* @param paramId
|
||||||
|
* the parameter ID of which to copy the value
|
||||||
|
* @param otherElement
|
||||||
|
* the element from which to get the value to copy
|
||||||
|
*/
|
||||||
|
public void copyParameterValue(String bagId, String paramId, GroupedParameterizedElement otherElement) {
|
||||||
|
Parameter<?> otherParam = otherElement.getParameter(bagId, paramId);
|
||||||
|
getParameter(paramId, true).setValue(otherParam.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a simple map where the keys are the IDs of the parameters and the values are the values of the
|
* Returns a simple map where the keys are the IDs of the parameters and the values are the values of the
|
||||||
* Parameters
|
* Parameters
|
||||||
|
|
Loading…
Reference in New Issue