diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/graph/neo4j/template/IterationController.java b/spring-data-neo4j/src/main/java/org/springframework/data/graph/neo4j/template/IterationController.java index fb1e9817a..bc026de4b 100644 --- a/spring-data-neo4j/src/main/java/org/springframework/data/graph/neo4j/template/IterationController.java +++ b/spring-data-neo4j/src/main/java/org/springframework/data/graph/neo4j/template/IterationController.java @@ -1,12 +1,32 @@ package org.springframework.data.graph.neo4j.template; /** -* @author mh -* @since 22.02.11 -*/ + * If the @{see PathMapper} implements this interface the returned @{see IterationMode} + * is considered for the path mapping operation. + * @author mh + * @since 22.02.11 + */ public interface IterationController { public enum IterationMode { - LAZY, EAGER, EAGER_STOP_ON_NULL, EAGER_IGNORE_RESULTS + /** + * doesn't evaluate before the iterable is accessed + */ + LAZY, + /** + * iterates eagerly over the results to ensure callbacks happening and also returns the full results + */ + EAGER, + /** + * iterates eagerly over the results to ensure callbacks happening, stops iteration on first encountered + * null value, useful for aborting iterations early + */ + EAGER_STOP_ON_NULL, + /** + * iterates eagerly over the results to ensure callbacks happening, ignores results and returns null from + * the iteration, i.e. callback only + */ + EAGER_IGNORE_RESULTS } + IterationMode getIterationMode(); } diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/graph/neo4j/template/PathMapper.java b/spring-data-neo4j/src/main/java/org/springframework/data/graph/neo4j/template/PathMapper.java index 1acc8bf5a..cd705dea9 100644 --- a/spring-data-neo4j/src/main/java/org/springframework/data/graph/neo4j/template/PathMapper.java +++ b/spring-data-neo4j/src/main/java/org/springframework/data/graph/neo4j/template/PathMapper.java @@ -15,6 +15,11 @@ import org.neo4j.graphdb.Path; */ public interface PathMapper { + /** + * map operation, converts the path to any other, specified type instance + * @param path given path + * @return mapped type instance + */ T mapPath(Path path); /**