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:
  • Constructor Details

    • RelationDescriptors

      public RelationDescriptors()
  • Method Details

    • 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 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)
      Returns ValidationResult, which indicates if two given entities may for a relation, described by a RelationDescriptor object. Validation will fail if the source or target are of the wrong type.
      Parameters:
      source - entity
      target - entity
      Returns:
      validation result