1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.neo4j.server.rest.repr;
21
22 import org.neo4j.graphdb.Path;
23
24 public class FullPathRepresentation extends ObjectRepresentation
25 {
26 private final Path path;
27
28 public FullPathRepresentation(Path path)
29 {
30 super( RepresentationType.FULL_PATH );
31 this.path = path;
32 }
33
34 @Mapping( "start" )
35 public NodeRepresentation startNode()
36 {
37 return new NodeRepresentation( path.startNode() );
38 }
39
40 @Mapping( "end" )
41 public NodeRepresentation endNode()
42 {
43 return new NodeRepresentation( path.endNode() );
44 }
45
46 @Mapping( "length" )
47 public ValueRepresentation length()
48 {
49 return ValueRepresentation.number( path.length() );
50 }
51
52 @Mapping( "nodes" )
53 public ListRepresentation nodes()
54 {
55 return NodeRepresentation.list(path.nodes());
56 }
57
58 @Mapping( "relationships" )
59 public ListRepresentation relationships()
60 {
61 return RelationshipRepresentation.list(path.relationships());
62 }
63 }