- 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 protectedDefaultValidatingRelationDescriptor(RelationDescriptor relationDescriptor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ValidationResultcanRelate(S source, T target)ReturnsValidationResult, which indicates if two given entities may form a relation, described by thisRelationDescriptorobjectStringgetRelationName()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:RelationDescriptorGet relation name. Relation name should be unique per relation type. For example: "favouriteContentRelation", "watchRelation" etc.- Specified by:
getRelationNamein interfaceRelationDescriptor<S extends Relatable,T extends Relatable>- Returns:
- relation name.
-
canRelate
public ValidationResult canRelate(S source, T target)
Description copied from interface:ValidatingRelationDescriptorReturnsValidationResult, which indicates if two given entities may form a relation, described by thisRelationDescriptorobject
-
getSourceClass
public Class<S> getSourceClass()
Description copied from interface:RelationDescriptorReturns class of source entity of the relation. Source entity is always subclass ofRelatable- Specified by:
getSourceClassin interfaceRelationDescriptor<S extends Relatable,T extends Relatable>- Returns:
- type of source entity
-
getTargetClass
public Class<T> getTargetClass()
Description copied from interface:RelationDescriptorReturns class of target entity of the relation. Target entity is always subclass ofRelatable- Specified by:
getTargetClassin interfaceRelationDescriptor<S extends Relatable,T extends Relatable>- Returns:
- type of target entity
-
-