Class Paths

java.lang.Object
org.neo4j.graphdb.traversal.Paths

public class Paths extends Object
Utilities for Path objects.
  • Method Details

    • pathToString

      public static <T extends Path> String pathToString(T path, Paths.PathDescriptor<T> builder)
      Method for building a string representation of a Path, using the given builder.
      Type Parameters:
      T - the type of Path.
      Parameters:
      path - the Path to build a string representation of.
      builder - the Paths.PathDescriptor to get Node and Relationship representations from.
      Returns:
      a string representation of a Path.
    • defaultPathToString

      public static String defaultPathToString(Path path)
      TODO: This method re-binds nodes and relationships. It should not. Returns the default string representation of a Path. It uses the Paths.DefaultPathDescriptor to get representations.
      Parameters:
      path - the Path to build a string representation of.
      Returns:
      the default string representation of a Path.
    • simplePathToString

      public static String simplePathToString(Path path)
      Returns a quite simple string representation of a Path. It doesn't print relationship types or ids, just directions.
      Parameters:
      path - the Path to build a string representation of.
      Returns:
      a quite simple representation of a Path.
    • simplePathToString

      public static String simplePathToString(Path path, String nodePropertyKey)
      Returns a quite simple string representation of a Path. It doesn't print relationship types or ids, just directions. it uses the nodePropertyKey to try to display that property value as in the node representation instead of the node id. If that property doesn't exist, the id is used.
      Parameters:
      path - the Path to build a string representation of.
      nodePropertyKey - the key of the property value to display
      Returns:
      a quite simple representation of a Path.
    • descriptorForIdAndProperties

      public static <T extends Path> Paths.PathDescriptor<T> descriptorForIdAndProperties(boolean nodeId, boolean relId, String... propertyKeys)
      Create a new Paths.PathDescriptor that prints values of listed property keys and id of nodes and relationships if configured so.
      Type Parameters:
      T - the type of the Path
      Parameters:
      nodeId - true if node id should be included.
      relId - true if relationship id should be included.
      propertyKeys - all property keys that should be included.
      Returns:
      a new Paths.PathDescriptor
    • singleNodePath

      public static Path singleNodePath(Node node)
    • defaultPathToStringWithNotInTransactionFallback

      public static String defaultPathToStringWithNotInTransactionFallback(Path path)