Class RelationshipUtils


  • public class RelationshipUtils
    extends Object
    • Method Detail

      • matchRelationshipType

        public static RelationshipType matchRelationshipType​(List<RelationshipType> relTypes,
                                                             String targetType,
                                                             String originType,
                                                             String originTypeName)
        Matches two Entity types to a Relationship Type from a set of Relationship Types. Given a list of Relationship Types, this method will find a Relationship Type that is configured between the originType and the targetType, with the matching originTypeName. It will match a relationship between these two entities in either direction (eg leftward or rightward). Example: originType = Author, targetType = Publication, originTypeName = isAuthorOfPublication.
        Parameters:
        relTypes - set of Relationship Types in which to find a match.
        targetType - entity type of target (eg. Publication).
        originType - entity type of origin referer (eg. Author).
        originTypeName - the name of the relationship (eg. isAuthorOfPublication)
        Returns:
        null or matched Relationship Type.