- 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
Constructors Modifier Constructor Description protected
AbstractRelationDescriptor(String relationName)
protected
AbstractRelationDescriptor(String relationName, Class<S> sourceClass, Class<T> targetClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Class
getGenericTypeArgs(int i)
String
getRelationName()
Get relation name.Class<S>
getSourceClass()
Returns class of source entity of the relation.Class<T>
getTargetClass()
Returns class of target entity of the relation.
-
-
-
Method Detail
-
getSourceClass
public Class<S> 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
public Class<T> 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
public String 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
protected Class getGenericTypeArgs(int i)
-
-