本文整理了Java中org.vertexium.Element.getVisibility()
方法的一些代码示例,展示了Element.getVisibility()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getVisibility()
方法的具体详情如下:
包路径:org.vertexium.Element
类名称:Element
方法名:getVisibility
[英]the visibility of the element.
[中]元素的可见性。
代码示例来源:origin: org.vertexium/vertexium-core
public ExistingElementMutationImpl(T element) {
this.element = element;
if (element != null) {
this.oldElementVisibility = element.getVisibility();
}
}
代码示例来源:origin: visallo/vertexium
public ExistingElementMutationImpl(T element) {
this.element = element;
if (element != null) {
this.oldElementVisibility = element.getVisibility();
}
}
代码示例来源:origin: org.visallo/visallo-core
public Visibility getVisibility() {
return getElement().getVisibility();
}
代码示例来源:origin: org.vertexium/vertexium-elasticsearch2
private String addElementTypeVisibilityPropertyToIndex(Graph graph, Element element) throws IOException {
String elementTypeVisibilityPropertyName = deflatePropertyName(graph, ELEMENT_TYPE_FIELD_NAME, element.getVisibility());
String indexName = getIndexName(element);
IndexInfo indexInfo = ensureIndexCreatedAndInitialized(graph, indexName);
addPropertyToIndex(graph, indexInfo, elementTypeVisibilityPropertyName, element.getVisibility(), String.class, false);
return elementTypeVisibilityPropertyName;
}
代码示例来源:origin: org.vertexium/vertexium-elasticsearch-singledocument
private String addElementTypeVisibilityPropertyToIndex(Graph graph, Element element) throws IOException {
String elementTypeVisibilityPropertyName = addVisibilityToPropertyName(graph, ELEMENT_TYPE_FIELD_NAME, element.getVisibility());
String indexName = getIndexName(element);
IndexInfo indexInfo = ensureIndexCreatedAndInitialized(graph, indexName);
addPropertyToIndex(graph, indexInfo, elementTypeVisibilityPropertyName, element.getVisibility(), String.class, false);
return elementTypeVisibilityPropertyName;
}
代码示例来源:origin: org.vertexium/vertexium-elasticsearch5
private String addElementTypeVisibilityPropertyToIndex(Graph graph, Element element) throws IOException {
String elementTypeVisibilityPropertyName = addVisibilityToPropertyName(graph, ELEMENT_TYPE_FIELD_NAME, element.getVisibility());
String indexName = getIndexName(element);
IndexInfo indexInfo = ensureIndexCreatedAndInitialized(indexName);
addPropertyToIndex(graph, indexInfo, elementTypeVisibilityPropertyName, element.getVisibility(), String.class, false, false, false);
return elementTypeVisibilityPropertyName;
}
代码示例来源:origin: visallo/vertexium
private String addElementTypeVisibilityPropertyToIndex(Graph graph, Element element) throws IOException {
String elementTypeVisibilityPropertyName = addVisibilityToPropertyName(graph, ELEMENT_TYPE_FIELD_NAME, element.getVisibility());
String indexName = getIndexName(element);
IndexInfo indexInfo = ensureIndexCreatedAndInitialized(indexName);
addPropertyToIndex(graph, indexInfo, elementTypeVisibilityPropertyName, element.getVisibility(), String.class, false, false, false);
return elementTypeVisibilityPropertyName;
}
代码示例来源:origin: org.vertexium/vertexium-core
@Override
protected boolean isMatch(Element element) {
for (String authorization : authorizations) {
if (element.getVisibility().hasAuthorization(authorization)) {
return true;
}
boolean hiddenVisibilityMatches = StreamUtils.stream(element.getHiddenVisibilities())
.anyMatch(visibility -> visibility.hasAuthorization(authorization));
if (hiddenVisibilityMatches) {
return true;
}
boolean propertyMatches = StreamUtils.stream(element.getProperties())
.anyMatch(property -> {
if (property.getVisibility().hasAuthorization(authorization)) {
return true;
}
return StreamUtils.stream(property.getHiddenVisibilities())
.anyMatch(visibility -> visibility.hasAuthorization(authorization));
});
if (propertyMatches) {
return true;
}
}
return false;
}
代码示例来源:origin: visallo/vertexium
@Override
protected boolean isMatch(Element element) {
for (String authorization : authorizations) {
if (element.getVisibility().hasAuthorization(authorization)) {
return true;
}
boolean hiddenVisibilityMatches = StreamUtils.stream(element.getHiddenVisibilities())
.anyMatch(visibility -> visibility.hasAuthorization(authorization));
if (hiddenVisibilityMatches) {
return true;
}
boolean propertyMatches = StreamUtils.stream(element.getProperties())
.anyMatch(property -> {
if (property.getVisibility().hasAuthorization(authorization)) {
return true;
}
return StreamUtils.stream(property.getHiddenVisibilities())
.anyMatch(visibility -> visibility.hasAuthorization(authorization));
});
if (propertyMatches) {
return true;
}
}
return false;
}
代码示例来源:origin: visallo/vertexium
private <TElement extends Element> IndexInfo addMutationPropertiesToIndex(Graph graph, ExistingElementMutation<TElement> mutation) {
TElement element = mutation.getElement();
IndexInfo indexInfo = addPropertiesToIndex(graph, element, mutation.getProperties());
mutation.getAlterPropertyVisibilities().stream()
.filter(p -> p.getExistingVisibility() != null && !p.getExistingVisibility().equals(p.getVisibility()))
.forEach(p -> {
PropertyDefinition propertyDefinition = getPropertyDefinition(graph, p.getName());
if (propertyDefinition != null) {
try {
addPropertyDefinitionToIndex(graph, indexInfo, p.getName(), p.getVisibility(), propertyDefinition);
} catch (Exception e) {
throw new VertexiumException("Unable to add property to index: " + p, e);
}
}
});
if (mutation.getNewElementVisibility() != null) {
try {
String newFieldName = addVisibilityToPropertyName(graph, ELEMENT_TYPE_FIELD_NAME, mutation.getNewElementVisibility());
addPropertyToIndex(graph, indexInfo, newFieldName, element.getVisibility(), String.class, false, false, false);
} catch (Exception e) {
throw new VertexiumException("Unable to add new element type visibility to index", e);
}
}
return indexInfo;
}
代码示例来源:origin: org.vertexium/vertexium-elasticsearch5
private <TElement extends Element> IndexInfo addMutationPropertiesToIndex(Graph graph, ExistingElementMutation<TElement> mutation) {
TElement element = mutation.getElement();
IndexInfo indexInfo = addPropertiesToIndex(graph, element, mutation.getProperties());
mutation.getAlterPropertyVisibilities().stream()
.filter(p -> p.getExistingVisibility() != null && !p.getExistingVisibility().equals(p.getVisibility()))
.forEach(p -> {
PropertyDefinition propertyDefinition = getPropertyDefinition(graph, p.getName());
if (propertyDefinition != null) {
try {
addPropertyDefinitionToIndex(graph, indexInfo, p.getName(), p.getVisibility(), propertyDefinition);
} catch (Exception e) {
throw new VertexiumException("Unable to add property to index: " + p, e);
}
}
});
if (mutation.getNewElementVisibility() != null) {
try {
String newFieldName = addVisibilityToPropertyName(graph, ELEMENT_TYPE_FIELD_NAME, mutation.getNewElementVisibility());
addPropertyToIndex(graph, indexInfo, newFieldName, element.getVisibility(), String.class, false, false, false);
} catch (Exception e) {
throw new VertexiumException("Unable to add new element type visibility to index", e);
}
}
return indexInfo;
}
代码示例来源:origin: org.vertexium/vertexium-elasticsearch
visibilityStrings.add(element.getVisibility().getVisibilityString());
内容来源于网络,如有侵权,请联系作者删除!