PathExpanderBuilder (Neo4j Community 2.1.0-M01 API)
Date: 2014-02-20

org.neo4j.graphdb

## Class PathExpanderBuilder

- java.lang.Object
- - org.neo4j.graphdb.PathExpanderBuilder

-     public class PathExpanderBuilder
      extends Object

  A fluent builder for creating specialized `path expanders`.

  See `PathExpanders` for a catalog of common expanders.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `PathExpanderBuilder` | `add(RelationshipType type)` Add a pair of `type` and `Direction.BOTH` to the PathExpander configuration.
    `PathExpanderBuilder` | `add(RelationshipType type, Direction direction)` Add a pair of `type` and `direction` to the PathExpander configuration.
    `static PathExpanderBuilder` | `allTypes(Direction direction)` A `PathExpanderBuilder` seeded with all possible types but restricted to `direction`.
    `static <STATE> PathExpanderBuilder` | `allTypesAndDirections()` A `PathExpanderBuilder` that is seeded with all possible relationship types in `both directions`.
    `<STATE> PathExpander<STATE>` | `build()` Produce a PathExpander from the configuration you have built up.
    `static PathExpanderBuilder` | `empty()` A `PathExpanderBuilder` that follows no relationships.
    `PathExpanderBuilder` | `remove(RelationshipType type)` Remove expansion of `type` in any direction from the PathExpander configuration.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### empty

          public static PathExpanderBuilder empty()

      A `PathExpanderBuilder` that follows no relationships. You start with this and use `add(RelationshipType, Direction)` to form a restrictive PathExpander with just a few expansion rules in it.

    - #### allTypesAndDirections

          public static <STATE> PathExpanderBuilder allTypesAndDirections()

      A `PathExpanderBuilder` that is seeded with all possible relationship types in `both directions`. You start with this and `remove types` to form a permissive `PathExpander` with just a few exceptions in it.

    - #### allTypes

          public static PathExpanderBuilder allTypes(Direction direction)

      A `PathExpanderBuilder` seeded with all possible types but restricted to `direction`. You start with this and `remove types` to form a permissive `PathExpander` with just a few exceptions in it.
      Parameters:
        `direction` - The direction you want to restrict expansions to

    - #### add

          public PathExpanderBuilder add(RelationshipType type)

      Add a pair of `type` and `Direction.BOTH` to the PathExpander configuration.

    - #### add

          public PathExpanderBuilder add(RelationshipType type,
                                Direction direction)

      Add a pair of `type` and `direction` to the PathExpander configuration.

    - #### remove

          public PathExpanderBuilder remove(RelationshipType type)

      Remove expansion of `type` in any direction from the PathExpander configuration.

      Example: `PathExpanderBuilder.allTypesAndDirections().remove(type).add(type, Direction.INCOMING)` would restrict the `PathExpander` to only follow `Direction.INCOMING` relationships for `type` while following any other relationship type in either direction.

    - #### build

          public <STATE> PathExpander<STATE> build()

      Produce a PathExpander from the configuration you have built up.

Copyright © 2002–2014 The Neo4j Graph Database Project. All rights reserved.