java.lang.Object
com.atlassian.confluence.api.model.relations.AbstractRelationDescriptor<S,T>
- All Implemented Interfaces:
RelationDescriptor<S,
T>
- Direct Known Subclasses:
CollaboratorRelationDescriptor
,CumulativeContributorRelationDescriptor
,FavouriteRelationDescriptor
,LikeRelationDescriptor
,NamedRelationDescriptor
,TouchedRelationDescriptor
@ExperimentalSpi
public abstract class AbstractRelationDescriptor<S extends Relatable,T extends Relatable>
extends Object
implements RelationDescriptor<S,T>
Relation descriptor, which should be used as a base class for all custom relation descriptors.
It is also very important to set-up correct type values (the custom relation is applicable for), as they
(along with relation name) define a relation type, and are used for validation, in relation search queries etc.
- Since:
- 5.9
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractRelationDescriptor
(String relationName) protected
-
Method Summary
Modifier and TypeMethodDescriptionprotected Class
getGenericTypeArgs
(int i) Get relation name.Returns class of source entity of the relation.Returns class of target entity of the relation.
-
Constructor Details
-
AbstractRelationDescriptor
-
AbstractRelationDescriptor
-
-
Method Details
-
getSourceClass
Description copied from interface:RelationDescriptor
Returns class of source entity of the relation. Source entity is always subclass ofRelatable
- Specified by:
getSourceClass
in interfaceRelationDescriptor<S extends Relatable,
T extends Relatable> - Returns:
- type of source entity
-
getTargetClass
Description copied from interface:RelationDescriptor
Returns class of target entity of the relation. Target entity is always subclass ofRelatable
- Specified by:
getTargetClass
in interfaceRelationDescriptor<S extends Relatable,
T extends Relatable> - Returns:
- type of target entity
-
getRelationName
Description copied from interface:RelationDescriptor
Get relation name. Relation name should be unique per relation type. For example: "favouriteContentRelation", "watchRelation" etc.- Specified by:
getRelationName
in interfaceRelationDescriptor<S extends Relatable,
T extends Relatable> - Returns:
- relation name.
-
getGenericTypeArgs
-