Class RelationDescriptors
- java.lang.Object
-
- com.atlassian.confluence.api.model.relations.RelationDescriptors
-
public final class RelationDescriptors extends Object
Provides static helper methods for RelationDescriptor objects.- Since:
- 5.9
- See Also:
RelationDescriptor
-
-
Constructor Summary
Constructors Constructor Description RelationDescriptors()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static <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).
-
-
-
Method Detail
-
lookupBuiltinOrCreate
public 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 relationshipname
- The name of the relationship - this may be a built-in name or arbitrary nametargetClass
- 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 aRelationDescriptor
object. Validation will fail if the source or target are of the wrong type.- Parameters:
source
- entitytarget
- entity- Returns:
- validation result
-
-