Package org.neo4j.graphdb.traversal
Class Paths
java.lang.Object
org.neo4j.graphdb.traversal.Paths
Utilities for
Path
objects.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Paths.DefaultPathDescriptor<T extends Path>
The defaultPaths.PathDescriptor
used in common toString() representations in classes implementingPath
.static interface
Paths.PathDescriptor<T extends Path>
Provides hooks to help build a string representation of aPath
.private static class
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
defaultPathToString
(Path path) TODO: This method re-binds nodes and relationships.static String
static <T extends Path>
Paths.PathDescriptor<T>descriptorForIdAndProperties
(boolean nodeId, boolean relId, String... propertyKeys) Create a newPaths.PathDescriptor
that prints values of listed property keys and id of nodes and relationships if configured so.pathToString
(T path, Paths.PathDescriptor<T> builder) Method for building a string representation of aPath
, using the givenbuilder
.static String
simplePathToString
(Path path) Returns a quite simple string representation of aPath
.static String
simplePathToString
(Path path, String nodePropertyKey) Returns a quite simple string representation of aPath
.static Path
singleNodePath
(Node node)
-
Method Details
-
pathToString
Method for building a string representation of aPath
, using the givenbuilder
.- Type Parameters:
T
- the type ofPath
.- Parameters:
path
- thePath
to build a string representation of.builder
- thePaths.PathDescriptor
to getNode
andRelationship
representations from.- Returns:
- a string representation of a
Path
.
-
defaultPathToString
TODO: This method re-binds nodes and relationships. It should not. Returns the default string representation of aPath
. It uses thePaths.DefaultPathDescriptor
to get representations. -
simplePathToString
Returns a quite simple string representation of aPath
. It doesn't print relationship types or ids, just directions. -
simplePathToString
Returns a quite simple string representation of aPath
. It doesn't print relationship types or ids, just directions. it uses thenodePropertyKey
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. -
descriptorForIdAndProperties
public static <T extends Path> Paths.PathDescriptor<T> descriptorForIdAndProperties(boolean nodeId, boolean relId, String... propertyKeys) Create a newPaths.PathDescriptor
that prints values of listed property keys and id of nodes and relationships if configured so.- Type Parameters:
T
- the type of thePath
- 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
-
defaultPathToStringWithNotInTransactionFallback
-