- java.lang.Object
-
- com.atlassian.confluence.api.impl.service.relation.DefaultValidatingRelationDescriptor<S,T>
-
- All Implemented Interfaces:
RelationDescriptor<S,T>
,ValidatingRelationDescriptor<S,T>
- Direct Known Subclasses:
AuthenticatedUserRelationDescriptor
public class DefaultValidatingRelationDescriptor<S extends Relatable,T extends Relatable> extends Object implements ValidatingRelationDescriptor<S,T>
- Since:
- 5.11
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DefaultValidatingRelationDescriptor(RelationDescriptor relationDescriptor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ValidationResult
canRelate(S source, T target)
ReturnsValidationResult
, which indicates if two given entities may form a relation, described by thisRelationDescriptor
objectString
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.
-
-
-
Constructor Detail
-
DefaultValidatingRelationDescriptor
protected DefaultValidatingRelationDescriptor(RelationDescriptor relationDescriptor)
-
-
Method Detail
-
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.
-
canRelate
public ValidationResult canRelate(S source, T target)
Description copied from interface:ValidatingRelationDescriptor
ReturnsValidationResult
, which indicates if two given entities may form a relation, described by thisRelationDescriptor
object
-
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
-
-