Class RelationDescriptors
java.lang.Object
com.atlassian.confluence.api.model.relations.RelationDescriptors
Provides static helper methods for RelationDescriptor objects.
- Since:
- 5.9
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <S extends Relatable,
T extends Relatable>
ValidationResultcanRelate
(S source, RelationDescriptor<S, T> relationDescriptor, T target) Deprecated.since 5.11.static <S extends Relatable,
T extends Relatable>
RelationDescriptor<S,T> lookupBuiltinOrCreate
(Class<S> sourceClass, String name, Class<T> targetClass) Get one of the built-in RelationDescriptor objects (for example FavouriteRelationDescriptor).
-
Constructor Details
-
RelationDescriptors
public RelationDescriptors()
-
-
Method Details
-
lookupBuiltinOrCreate
public static <S extends Relatable,T extends Relatable> RelationDescriptor<S,T> lookupBuiltinOrCreate(Class<S> sourceClass, String name, Class<T> targetClass) Get one of the built-in RelationDescriptor objects (for example FavouriteRelationDescriptor). If a built-in relationship doesn't exist for the relation name, create a new NamedRelationDescriptor.- Parameters:
sourceClass
- The source type of the relationshipname
- The name of the relationship - this may be a built-in name or arbitrary nametargetClass
- The target type of the relationship- Returns:
- The built-in or created RelationDescriptor object
-
canRelate
@Deprecated public static <S extends Relatable,T extends Relatable> ValidationResult canRelate(S source, RelationDescriptor<S, T> relationDescriptor, T target) Deprecated.since 5.11. UseValidatingRelationDescriptor.canRelate(Relatable, Relatable)
insteadReturnsValidationResult
, which indicates if two given entities may for a relation, described by aRelationDescriptor
object. Validation will fail if the source or target are of the wrong type.- Parameters:
source
- entitytarget
- entity- Returns:
- validation result
-