public class VersionPropertyService
extends java.lang.Object
| Constructor and Description |
|---|
VersionPropertyService(net.brokenbuild.subcomponents.service.customprops.propvalue.PropValueHelper propValueHelper) |
| Modifier and Type | Method and Description |
|---|---|
java.util.Optional<java.lang.String> |
getValue(long versionId,
int propertyId)
Retrieves the value of a specified property for a given version ID.
|
java.lang.String |
setValue(long versionId,
int propertyId,
java.lang.String propValue)
Sets the value of a specified property name for a given version ID.
|
public VersionPropertyService(net.brokenbuild.subcomponents.service.customprops.propvalue.PropValueHelper propValueHelper)
public java.util.Optional<java.lang.String> getValue(long versionId,
int propertyId)
This method fetches the value of a property associated with a specific version based on the given version ID
and property name. If the user is unauthorized to access this data, a SubcomponentsAuthException is thrown.
If any other error occurs during the process, a SubcomponentsApiException is thrown.
versionId - The ID of the version for which the property value needs to be fetched.propertyId - The name of the property whose value is to be retrieved.Optional containing the property value if found, or an empty Optional if not found.SubcomponentsAuthException - if the user is unauthorized to access the property value.SubcomponentsApiException - if any other error occurs while fetching the property value.public java.lang.String setValue(long versionId,
int propertyId,
java.lang.String propValue)
This method sets the value of a property associated with a specific version based on the given version ID,
property id, and the new value to be set. If the updated value doesn't pass validation, a
SubcomponentsValidationException is thrown. If the user is unauthorized to update this data,
a SubcomponentsAuthException is thrown. For other unexpected errors, a SubcomponentsApiException
is thrown.
versionId - The ID of the version for which the property value needs to be updated.propertyId - The ID of the property whose value is to be updated.propValue - The new value for the property.SubcomponentsValidationException - if the updated value fails validation checks.SubcomponentsAuthException - if the user is unauthorized to update the property value.SubcomponentsApiException - if any other error occurs while updating the property value.