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 SummaryConstructors
- 
Method SummaryModifier 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- 
RelationDescriptorspublic RelationDescriptors()
 
- 
- 
Method Details- 
lookupBuiltinOrCreatepublic 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 relationship
- name- The name of the relationship - this may be a built-in name or arbitrary name
- targetClass- 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 aRelationDescriptorobject. Validation will fail if the source or target are of the wrong type.- Parameters:
- source- entity
- target- entity
- Returns:
- validation result
 
 
-