void setIdentifiers(final Object source, final Object destination, final DirectedType directedType, final MatchedVertex matchedVertex);
@JsonIgnore default Object getAdjacentMatchedVertexValue() { return MatchedVertex.DESTINATION == getMatchedVertex() ? getSource() : getDestination(); }
@JsonIgnore default Object getMatchedVertexValue() { return MatchedVertex.DESTINATION == getMatchedVertex() ? getDestination() : getSource(); }
void setIdentifiers(final Object source, final Object destination, final DirectedType directedType, final MatchedVertex matchedVertex);
@JsonIgnore default Object getMatchedVertexValue() { return MatchedVertex.DESTINATION == getMatchedVertex() ? getDestination() : getSource(); }
@JsonIgnore default Object getAdjacentMatchedVertexValue() { return MatchedVertex.DESTINATION == getMatchedVertex() ? getSource() : getDestination(); }
@SuppressFBWarnings(value = "BC_UNCONFIRMED_CAST", justification = "element provided should always be an Edge") @Override public void loadIdentifiers(final Element edge) { final EdgeId edgeId = (EdgeId) elementConverter.getElementId(key, includeMatchedVertex); ((Edge) edge).setIdentifiers(edgeId.getSource(), edgeId.getDestination(), edgeId.isDirected(), edgeId.getMatchedVertex()); } }
@Override public CloseableIterator<EntityId> iterator() { // For each EntityId, get relevant edges with group-by properties // Create full Element // Apply view // Extract adjacent vertices Stream<Element> elementStream = Streams.toStream(getAdjacentIds.getInput()) .flatMap(entityId -> GetElementsUtil.getRelevantElements(mapImpl, entityId, getAdjacentIds.getView(), getAdjacentIds.getDirectedType(), getAdjacentIds.getIncludeIncomingOutGoing(), SeedMatching.SeedMatchingType.RELATED) .stream() .map(mapImpl::getAggElement)); // Apply the view elementStream = GetElementsUtil.applyView(elementStream, schema, getAdjacentIds.getView()); final Stream<EntityId> adjacentIdsStream = elementStream .filter(Objects::nonNull) .map(element -> { final Object nextVertex; if (EdgeId.MatchedVertex.DESTINATION == ((EdgeId) element).getMatchedVertex()) { nextVertex = ((EdgeId) element).getSource(); } else { nextVertex = ((EdgeId) element).getDestination(); } return new EntitySeed(nextVertex); }); return new WrappedCloseableIterator<>(adjacentIdsStream.iterator()); } }
if (EdgeId.MatchedVertex.DESTINATION == ((EdgeId) elementId).getMatchedVertex()) { nextId = new EntitySeed(((EdgeId) elementId).getSource()); } else {