Class RelationUtils
java.lang.Object
com.atlassian.confluence.internal.relations.RelationUtils
- Since:
- 5.9
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
extractError
(ValidationResult validationResult, String defaultMessage) Extracts all errors from theValidationResult
as a singleString
.static ValidationResult
validateAgainstApiModel
(RelatableEntity source, RelatableEntity target, RelationDescriptor relationDescriptor) Helper method, which can be used to validate relation based on input parameters.
-
Constructor Details
-
RelationUtils
public RelationUtils()
-
-
Method Details
-
validateAgainstApiModel
public static ValidationResult validateAgainstApiModel(RelatableEntity source, RelatableEntity target, RelationDescriptor relationDescriptor) Helper method, which can be used to validate relation based on input parameters. It knows how to transform API Domain classes (over whichRelationDescriptor
is built) into corresponding Hibernate's classes (which implementRelatableEntity
interface), and perform validation.- Parameters:
source
-target
-relationDescriptor
-- Returns:
ValidationResult
-
extractError
Extracts all errors from theValidationResult
as a singleString
. Is used to form appropriate exception message when validation fails.- Parameters:
validationResult
-defaultMessage
-- Returns:
- extracted error messages, separated with new line separator
(\n)
-