Class RelationUtils
- java.lang.Object
-
- com.atlassian.confluence.internal.relations.RelationUtils
-
public class RelationUtils extends Object
- Since:
- 5.9
-
-
Constructor Summary
Constructors Constructor Description RelationUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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.
-
-
-
Method Detail
-
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
public static String extractError(ValidationResult validationResult, String defaultMessage)
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)
-
-