本文整理汇总了Java中org.apache.tinkerpop.gremlin.structure.VertexProperty.value方法的典型用法代码示例。如果您正苦于以下问题:Java VertexProperty.value方法的具体用法?Java VertexProperty.value怎么用?Java VertexProperty.value使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.tinkerpop.gremlin.structure.VertexProperty
的用法示例。
在下文中一共展示了VertexProperty.value方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DetachedVertexProperty
import org.apache.tinkerpop.gremlin.structure.VertexProperty; //导入方法依赖的package包/类
protected DetachedVertexProperty(final VertexProperty<V> vertexProperty, final boolean withProperties) {
super(vertexProperty);
this.value = vertexProperty.value();
this.vertex = DetachedFactory.detach(vertexProperty.element(), false);
// only serialize properties if requested, the graph supports it and there are meta properties present.
// this prevents unnecessary object creation of a new HashMap which will just be empty. it will use
// Collections.emptyMap() by default
if (withProperties && vertexProperty.graph().features().vertex().supportsMetaProperties()) {
final Iterator<Property<Object>> propertyIterator = vertexProperty.properties();
if (propertyIterator.hasNext()) {
this.properties = new HashMap<>();
propertyIterator.forEachRemaining(property -> this.properties.put(property.key(), Collections.singletonList(DetachedFactory.detach(property))));
}
}
}
示例2: getPropertyOrEmptyString
import org.apache.tinkerpop.gremlin.structure.VertexProperty; //导入方法依赖的package包/类
public static String getPropertyOrEmptyString(final Vertex vertex, final String propertyKey) {
VertexProperty<String> property = vertex.property(propertyKey);
if (property.isPresent()) {
return property.value();
}
return "";
}
示例3: getPropertyOrFail
import org.apache.tinkerpop.gremlin.structure.VertexProperty; //导入方法依赖的package包/类
public static String getPropertyOrFail(final Vertex vertex, final String propertyKey) {
VertexProperty<String> property = vertex.property(propertyKey);
if (property.isPresent()) {
return property.value();
}
throw new IllegalStateException(
String.format("The vertex with id '%s' does not conatin the expected property '%s'.", vertex.id(),
propertyKey));
}
示例4: getPropertyOrNull
import org.apache.tinkerpop.gremlin.structure.VertexProperty; //导入方法依赖的package包/类
public static String getPropertyOrNull(final Vertex vertex, final String propertyKey) {
VertexProperty<String> property = vertex.property(propertyKey);
if (property.isPresent()) {
return property.value();
}
return null;
}
示例5: ReferenceVertexProperty
import org.apache.tinkerpop.gremlin.structure.VertexProperty; //导入方法依赖的package包/类
public ReferenceVertexProperty(final VertexProperty<V> vertexProperty) {
super(vertexProperty);
this.vertex = ReferenceFactory.detach(vertexProperty.element());
this.key = vertexProperty.key();
this.value = vertexProperty.value();
}