}
public static NodeWrapper extractToNodeWrapper( Node node, boolean includeRelation )
{
NodeWrapper nodeWrapper = new NodeWrapper( node.getId() );
Map<String, Object> oMap = extractToMapFromProperties( node );
nodeWrapper.setPropertyMap( oMap );
if ( node.hasRelationship() && includeRelation )
{
for ( Relationship relationship : node.getRelationships( Direction.OUTGOING ) )
{
RelationshipWrapper rw = new RelationshipWrapper( relationship.getId() );
relationship.getType().name();
rw.setEndNodeId( relationship.getEndNode().getId() );
rw.setPropertyMap( extractToMapFromProperties( relationship ) );
rw.setRelationshipType( relationship.getType().name() );
nodeWrapper.addRelation( rw );
}
}
return nodeWrapper;
}