Class BaseIncludeRelationships<T extends BaseIncludeRelationships<T>>

    • Constructor Detail

      • BaseIncludeRelationships

        protected BaseIncludeRelationships​(Direction direction,
                                           String[] relationshipTypes,
                                           DetachedPropertiesDescription propertiesDescription)
        Create a new policy.
        Parameters:
        direction - that matching relationships must have, Direction.BOTH for both.
        relationshipTypes - one of which the matching relationships must have, empty for all.
        propertiesDescription - of the matching relationships.
    • Method Detail

      • with

        public T with​(String... relationshipTypes)
        Create a new policy from the current one, reconfigured to only match relationships with the given relationship types.
        Parameters:
        relationshipTypes - one of which the matching relationships must have, empty for all.
        Returns:
        reconfigured policy.
      • with

        public T with​(RelationshipType... relationshipTypes)
        Create a new policy from the current one, reconfigured to only match relationships with the given relationship types.
        Parameters:
        relationshipTypes - one of which the matching relationships must have, empty for all.
        Returns:
        reconfigured policy.
      • with

        public T with​(Direction direction)
        Create a new policy from the current one, reconfigured to only match relationships with the given direction.
        Parameters:
        direction - that matching relationships must have, Direction.BOTH for both.
        Returns:
        reconfigured policy.
      • with

        public T with​(Direction direction,
                      RelationshipType... relationshipTypes)
        Create a new policy from the current one, reconfigured to only match relationships with the given direction and relationship types.
        Parameters:
        direction - that matching relationships must have, Direction.BOTH for both.
        relationshipTypes - one of which the matching relationships must have, empty for all.
        Returns:
        reconfigured policy.
      • with

        public T with​(Direction direction,
                      String... relationshipTypes)
        Create a new policy from the current one, reconfigured to only match relationships with the given direction and relationship types.
        Parameters:
        direction - that matching relationships must have, Direction.BOTH for both.
        relationshipTypes - one of which the matching relationships must have, empty for all.
        Returns:
        reconfigured policy.
      • newInstance

        protected abstract T newInstance​(Direction direction,
                                         String... relationshipTypes)
        Create a new instance of this policy with the given direction and relationship types.
        Parameters:
        direction - of the new policy.
        relationshipTypes - of the new policy.
        Returns:
        new policy.
      • include

        public boolean include​(Relationship relationship,
                               Node pointOfView)
        Description copied from interface: RelationshipInclusionPolicy
        Include the given relationships from the given node's point of view?
        Specified by:
        include in interface RelationshipInclusionPolicy
        Parameters:
        relationship - to make a decision on.
        pointOfView - node looking at the relationship. Must be one of the relationship's nodes.
        Returns:
        true to include, false to exclude.
      • getDirection

        public Direction getDirection()
        Get the direction with which this policy has been configured.
        Returns:
        direction, never null.
      • getRelationshipTypes

        public String[] getRelationshipTypes()
        Get the relationship types with which this policy has been configured.
        Returns:
        types, never null.