This repository has been archived by the owner on Jan 8, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move transaction check to superclass
- Loading branch information
1 parent
a66d710
commit 273d509
Showing
3 changed files
with
27 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/main/java/de/maltemoeser/bcgraph/traversal/evaluator/TransactionEvaluator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package de.maltemoeser.bcgraph.traversal.evaluator; | ||
|
||
import de.maltemoeser.bcgraph.entities.BCTransaction; | ||
import org.neo4j.graphdb.Path; | ||
import org.neo4j.graphdb.traversal.Evaluation; | ||
|
||
|
||
public abstract class TransactionEvaluator { | ||
|
||
BCTransaction transaction; | ||
|
||
public Evaluation evaluate(Path path) { | ||
transaction = new BCTransaction(path.endNode()); | ||
|
||
if (!transaction.isTransaction()) { | ||
throw new UnsupportedOperationException("A TransactionEvaluator can only be used with transaction nodes."); | ||
} | ||
|
||
return doEvaluate(path); | ||
} | ||
|
||
public abstract Evaluation doEvaluate(Path path); | ||
} |