Class Relationship

    • Method Detail

      • named

        public Relationship named​(java.lang.String newSymbolicName)
        Creates a copy of this relationship with a new symbolic name.
        Specified by:
        named in interface RelationshipPattern
        Parameters:
        newSymbolicName - the new symbolic name.
        Returns:
        The new relationship.
      • named

        public Relationship named​(SymbolicName newSymbolicName)
        Creates a copy of this relationship with a new symbolic name.
        Parameters:
        newSymbolicName - the new symbolic name.
        Returns:
        The new relationship.
      • unbounded

        public Relationship unbounded()
        Creates a new relationship with an unbound length minimum length
        Returns:
        the new relationship
        Since:
        1.1.1
      • min

        public Relationship min​(java.lang.Integer minimum)
        Creates a new relationship with a new minimum length
        Parameters:
        minimum - the new minimum
        Returns:
        the new relationship
      • max

        public Relationship max​(java.lang.Integer maximum)
        Creates a new relationship with a new maximum length
        Parameters:
        maximum - the new maximum
        Returns:
        the new relationship
      • length

        public Relationship length​(java.lang.Integer minimum,
                                   java.lang.Integer maximum)
        Creates a new relationship with a new length
        Parameters:
        minimum - the new minimum
        maximum - the new maximum
        Returns:
        the new relationship
      • withProperties

        public Relationship withProperties​(MapExpression<?> newProperties)
        Description copied from interface: ExposesProperties
        Creates a a copy of this property container with additional properties. Creates a property container without properties when no properties are passed to this method.
        Specified by:
        withProperties in interface ExposesProperties<Relationship>
        Parameters:
        newProperties - the new properties (can be null to remove exiting properties).
        Returns:
        The new property container.
      • withProperties

        public Relationship withProperties​(java.lang.Object... keysAndValues)
        Description copied from interface: ExposesProperties
        Creates a a copy of this property container with additional properties. Creates a property container without properties when no properties are passed to this method.
        Specified by:
        withProperties in interface ExposesProperties<Relationship>
        Parameters:
        keysAndValues - A list of key and values. Must be an even number, with alternating String and Expression.
        Returns:
        The new property container.
      • property

        public Property property​(java.lang.String name)
        Description copied from interface: PropertyContainer
        Creates a new Property associated with this property container. This property can be used as a lookup in other expressions. It does not add a value to the property.

        Note: The property container does not track property creation and there is no possibility to enumerate all properties that have been created for this property container.

        Specified by:
        property in interface PropertyContainer
        Parameters:
        name - property name, must not be null or empty.
        Returns:
        a new Property associated with this Relationship.
      • accept

        public void accept​(Visitor visitor)
        Description copied from interface: Visitable
        Accept a Visitor visiting this Visitable and its nested Visitables if applicable.
        Specified by:
        accept in interface Visitable
        Parameters:
        visitor - the visitor to notify, must not be null.
      • project

        public MapProjection project​(java.lang.Object... entries)
        Creates a map projection based on this relationship. The relationship needs a symbolic name for this to work.

        Entries of type String in entries followed by an Expression will be treated as map keys pointing to the expression in the projection, String entries alone will be treated as property lookups on the node.

        Parameters:
        entries - A list of entries for the projection
        Returns:
        A map projection.