本文整理了Java中org.vertexium.Element.getId()
方法的一些代码示例,展示了Element.getId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getId()
方法的具体详情如下:
包路径:org.vertexium.Element
类名称:Element
方法名:getId
暂无
代码示例来源:origin: org.vertexium/vertexium-cypher
@Override
public String toString() {
return "{" +
"name='" + name + '\'' +
", " + (element instanceof Vertex ? "vertex" : "edge") + "Id=" + (element == null ? null : element.getId()) +
'}';
}
代码示例来源:origin: org.vertexium/vertexium-core
public static <T extends Element> Map<String, T> toMapById(Iterable<T> elements) {
Map<String, T> result = new HashMap<>();
for (T element : elements) {
if (element != null) {
result.put(element.getId(), element);
}
}
return result;
}
}
代码示例来源:origin: org.vertexium/vertexium-core
@Override
default int compareTo(Object o) {
if (getClass().isInstance(o)) {
return getId().compareTo(((Element) o).getId());
}
throw new ClassCastException("o must be an " + getClass().getName());
}
}
代码示例来源:origin: visallo/vertexium
@Override
public boolean equals(Object obj) {
if (obj instanceof Element) {
Element objElem = (Element) obj;
return getId().equals(objElem.getId());
}
return super.equals(obj);
}
代码示例来源:origin: org.vertexium/vertexium-accumulo
@Override
public boolean equals(Object obj) {
if (obj instanceof Element) {
Element objElem = (Element) obj;
return getId().equals(objElem.getId());
}
return super.equals(obj);
}
代码示例来源:origin: org.vertexium/vertexium-core
@Override
public boolean equals(Object obj) {
if (obj instanceof Element) {
Element objElem = (Element) obj;
return getId().equals(objElem.getId());
}
return super.equals(obj);
}
代码示例来源:origin: visallo/vertexium
@Override
public boolean equals(Object obj) {
if (obj instanceof Element) {
Element objElem = (Element) obj;
return getId().equals(objElem.getId());
}
return super.equals(obj);
}
代码示例来源:origin: org.visallo/visallo-core
private void addElementTypeToJson(GraphPropertyMessage data, Element element) {
if (element instanceof Vertex) {
data.setGraphVertexId(new String[]{element.getId()});
} else if (element instanceof Edge) {
data.setGraphEdgeId(new String[]{element.getId()});
} else {
throw new VisalloException("Unexpected element type: " + element.getClass().getName());
}
}
代码示例来源:origin: org.vertexium/vertexium-cypher
private boolean isAttached(VertexiumCypherQueryContext ctx, Vertex vertex, Stream<DeleteElementItem> elementsToDelete) {
for (String vertexId : vertex.getVertexIds(Direction.BOTH, ctx.getAuthorizations())) {
if (elementsToDelete.noneMatch(e -> vertexId.equals(e.element.getId()))) {
return true;
}
}
return false;
}
代码示例来源:origin: org.vertexium/vertexium-core
@SuppressWarnings("unchecked")
@Override
protected T convert(VertexiumObject vertexiumObject) {
if (vertexiumObject instanceof Element) {
return (T) ((Element) vertexiumObject).getId();
} else if (vertexiumObject instanceof ExtendedDataRow) {
return (T) ((ExtendedDataRow) vertexiumObject).getId();
}
throw new VertexiumException("Unsupported class: " + vertexiumObject.getClass().getName());
}
代码示例来源:origin: visallo/vertexium
private boolean isAttached(VertexiumCypherQueryContext ctx, Vertex vertex, Stream<DeleteElementItem> elementsToDelete) {
for (String vertexId : vertex.getVertexIds(Direction.BOTH, ctx.getAuthorizations())) {
if (elementsToDelete.noneMatch(e -> vertexId.equals(e.element.getId()))) {
return true;
}
}
return false;
}
代码示例来源:origin: visallo/vertexium
public static void assertElementIds(Iterable<? extends Element> elements, String... ids) {
List<Element> elementList = toList(elements);
assertEquals("ids length mismatch", ids.length, elementList.size());
for (int i = 0; i < ids.length; i++) {
assertEquals("at offset: " + i, ids[i], elementList.get(i).getId());
}
}
代码示例来源:origin: org.vertexium/vertexium-test
public static void assertElementIds(Iterable<? extends Element> elements, String... ids) {
List<Element> elementList = toList(elements);
assertEquals("ids length mismatch", ids.length, elementList.size());
for (int i = 0; i < ids.length; i++) {
assertEquals("at offset: " + i, ids[i], elementList.get(i).getId());
}
}
代码示例来源:origin: org.visallo/visallo-core
public static JSONObject toJsonElement(Element element, String workspaceId) {
JSONObject json = new JSONObject();
json.put("id", element.getId());
json.put("properties", toJsonProperties(element.getProperties(), workspaceId));
json.put("sandboxStatus", SandboxStatusUtil.getSandboxStatus(element, workspaceId).toString());
VisibilityJson visibilityJson = VisalloProperties.VISIBILITY_JSON.getPropertyValue(element);
if (visibilityJson != null) {
json.put("visibilitySource", visibilityJson.getSource());
}
return json;
}
代码示例来源:origin: org.visallo/visallo-core
protected void pushTextUpdated(GraphPropertyWorkData data) {
if (data == null || data.getElement() == null) {
return;
}
getWorkQueueRepository().pushTextUpdated(data.getElement().getId(), data.getPriority());
}
代码示例来源:origin: org.vertexium/vertexium-elasticsearch-singledocument
@Override
public void deleteElement(Graph graph, Element element, Authorizations authorizations) {
deleteExtendedDataForElement(element);
String indexName = getIndexName(element);
String id = element.getId();
if (MUTATION_LOGGER.isTraceEnabled()) {
LOGGER.trace("deleting document %s", id);
}
getClient().prepareDelete(indexName, ELEMENT_TYPE, id).execute().actionGet();
}
代码示例来源:origin: org.vertexium/vertexium-core
protected void deleteAllExtendedDataForElement(Element element, Authorizations authorizations) {
if (!element.getFetchHints().isIncludeExtendedDataTableNames() || element.getExtendedDataTableNames().size() <= 0) {
return;
}
for (ExtendedDataRow row : getExtendedData(ElementType.getTypeFromElement(element), element.getId(), null, authorizations)) {
deleteExtendedDataRow(row.getId(), authorizations);
}
}
代码示例来源:origin: org.vertexium/vertexium-elasticsearch-singledocument
public void addElementToBulkRequest(Graph graph, BulkRequest bulkRequest, IndexInfo indexInfo, Element element, Authorizations authorizations) {
try {
XContentBuilder json = buildJsonContentFromElement(graph, element, authorizations);
UpdateRequest indexRequest = new UpdateRequest(indexInfo.getIndexName(), ELEMENT_TYPE, element.getId()).doc(json);
indexRequest.retryOnConflict(MAX_RETRIES);
indexRequest.docAsUpsert(true);
bulkRequest.add(indexRequest);
} catch (IOException ex) {
throw new VertexiumException("Could not add element to bulk request", ex);
}
}
代码示例来源:origin: org.vertexium/vertexium-elasticsearch2
public void addElementToBulkRequest(Graph graph, BulkRequest bulkRequest, IndexInfo indexInfo, Element element, Authorizations authorizations) {
try {
XContentBuilder json = buildJsonContentFromElement(graph, element, authorizations);
UpdateRequest indexRequest = new UpdateRequest(indexInfo.getIndexName(), ELEMENT_TYPE, element.getId()).doc(json);
indexRequest.retryOnConflict(MAX_RETRIES);
indexRequest.docAsUpsert(true);
bulkRequest.add(indexRequest);
} catch (IOException ex) {
throw new VertexiumException("Could not add element to bulk request", ex);
}
}
代码示例来源:origin: org.visallo/visallo-common-rdf
private void writeMetadataEntryRdfTriple(Element element, Property property, Metadata.Entry entry, OutputStream out) throws IOException {
write(new SetMetadataVisalloRdfTriple(
element instanceof Vertex ? ElementType.VERTEX : ElementType.EDGE,
element.getId(),
getVisibilitySource(element),
property.getKey(),
property.getName(),
getVisibilitySource(property),
entry.getKey(),
entry.getVisibility().toString(),
entry.getValue()
), out);
}
内容来源于网络,如有侵权,请联系作者删除!