@Override public void setIdentifiers(final Object source, final Object destination, final boolean directed, final MatchedVertex matchedVertex) { edge.setIdentifiers(source, destination, directed, matchedVertex); identifiersLoaded = true; }
@Override public void setIdentifiers(final Object source, final Object destination, final DirectedType directedType) { edge.setIdentifiers(source, destination, directedType); identifiersLoaded = true; }
/** * Sets the identifiers for an Edge. * <p> * If the edge is undirected the the source and destination vertices may get * swapped to ensure undirected edges are consistently constructed. * </p> * * @param source the source vertex * @param destination the destination vertex * @param directed true if the edge is directed */ public void setIdentifiers(final Object source, final Object destination, final boolean directed) { setIdentifiers(source, destination, directed, matchedVertex); }
/** * Sets the identifiers for an Edge. * <p> * If the edge is undirected the the source and destination vertices may get * swapped to ensure undirected edges are consistently constructed. * </p> * * @param source the source vertex * @param destination the destination vertex * @param directedType the edge directedType */ @Override public void setIdentifiers(final Object source, final Object destination, final DirectedType directedType) { setIdentifiers(source, destination, directedType.isDirected()); }
/** * Sets the identifiers for an Edge. * <p> * If the edge is undirected the the source and destination vertices may get * swapped to ensure undirected edges are consistently constructed. * </p> * * @param source the source vertex * @param destination the destination vertex * @param directedType the edge directedType * @param matchedVertex the vertex that matched a query seed */ @Override public void setIdentifiers(final Object source, final Object destination, final DirectedType directedType, final MatchedVertex matchedVertex) { setIdentifiers(source, destination, directedType.isDirected(), matchedVertex); }
@Test public void shouldDelegateSetIdentifiersToEdge() { // Given final Edge edge = mock(Edge.class); given(edge.getProperties()).willReturn(mock(Properties.class)); final ElementValueLoader edgeLoader = mock(ElementValueLoader.class); final LazyEdge lazyEdge = new LazyEdge(edge, edgeLoader); // When lazyEdge.setIdentifiers("src", "dest", DirectedType.UNDIRECTED); // Then verify(edgeLoader, never()).loadIdentifiers(edge); verify(edge).setIdentifiers("src", "dest", DirectedType.UNDIRECTED); }
@Test public void shouldSetIdentifiers() { // Given final Edge edge1 = new Edge(TestGroups.EDGE, 1, 2, false); final Edge edge2 = new Edge(TestGroups.EDGE_2, 4, 3, false); // When edge1.setIdentifiers(4, 3, false); edge1.setGroup(TestGroups.EDGE_2); // Then assertEquals(3, edge1.getSource()); assertThat(edge1, equalTo(edge2)); }
@Override public void setIdentifiers(final Object source, final Object destination, final boolean directed, final MatchedVertex matchedVertex) { edge.setIdentifiers(source, destination, directed, matchedVertex); identifiersLoaded = true; }
@Override public void setIdentifiers(final Object source, final Object destination, final DirectedType directedType) { edge.setIdentifiers(source, destination, directedType); identifiersLoaded = true; }
/** * Sets the identifiers for an Edge. * <p> * If the edge is undirected the the source and destination vertices may get * swapped to ensure undirected edges are consistently constructed. * </p> * * @param source the source vertex * @param destination the destination vertex * @param directed true if the edge is directed */ public void setIdentifiers(final Object source, final Object destination, final boolean directed) { setIdentifiers(source, destination, directed, matchedVertex); }
/** * Sets the identifiers for an Edge. * <p> * If the edge is undirected the the source and destination vertices may get * swapped to ensure undirected edges are consistently constructed. * </p> * * @param source the source vertex * @param destination the destination vertex * @param directedType the edge directedType */ @Override public void setIdentifiers(final Object source, final Object destination, final DirectedType directedType) { setIdentifiers(source, destination, directedType.isDirected()); }
/** * Sets the identifiers for an Edge. * <p> * If the edge is undirected the the source and destination vertices may get * swapped to ensure undirected edges are consistently constructed. * </p> * * @param source the source vertex * @param destination the destination vertex * @param directedType the edge directedType * @param matchedVertex the vertex that matched a query seed */ @Override public void setIdentifiers(final Object source, final Object destination, final DirectedType directedType, final MatchedVertex matchedVertex) { setIdentifiers(source, destination, directedType.isDirected(), matchedVertex); }
@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()); } }
((Edge) e).setIdentifiers(src, dst, isDir);
private void updateElementIndex(final Element element, final MapImpl mapImpl) { if (element instanceof Entity) { final Entity entity = (Entity) element; final EntityId entityId = new EntitySeed(entity.getVertex()); mapImpl.addIndex(entityId, element); } else { final Edge edge = (Edge) element; edge.setIdentifiers(edge.getSource(), edge.getDestination(), edge.isDirected(), EdgeId.MatchedVertex.SOURCE); final EntityId sourceEntityId = new EntitySeed(edge.getSource()); mapImpl.addIndex(sourceEntityId, edge); final Edge destMatchedEdge = new Edge(edge.getGroup(), edge.getSource(), edge.getDestination(), edge.isDirected(), EdgeId.MatchedVertex.DESTINATION, edge.getProperties()); final EntityId destinationEntityId = new EntitySeed(edge.getDestination()); mapImpl.addIndex(destinationEntityId, destMatchedEdge); final EdgeId edgeId = new EdgeSeed(edge.getSource(), edge.getDestination(), edge.isDirected()); mapImpl.addIndex(edgeId, edge); } } }