Esempio n. 1
0
 private TypedId getStartOrEnd(NodeOrRelationship current, String arg) throws ShellException {
   if (!current.isRelationship()) {
     throw new ShellException("Only allowed on relationships");
   }
   Node newNode = null;
   if (arg.equals(START_ALIAS)) {
     newNode = current.asRelationship().getStartNode();
   } else if (arg.equals(END_ALIAS)) {
     newNode = current.asRelationship().getEndNode();
   } else {
     throw new ShellException("Unknown alias '" + arg + "'");
   }
   return NodeOrRelationship.wrap(newNode).getTypedId();
 }