当前位置: 首页>>代码示例>>Java>>正文


Java VertexProperty.properties方法代码示例

本文整理汇总了Java中org.apache.tinkerpop.gremlin.structure.VertexProperty.properties方法的典型用法代码示例。如果您正苦于以下问题:Java VertexProperty.properties方法的具体用法?Java VertexProperty.properties怎么用?Java VertexProperty.properties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.tinkerpop.gremlin.structure.VertexProperty的用法示例。


在下文中一共展示了VertexProperty.properties方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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))));
        }
    }
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:17,代码来源:DetachedVertexProperty.java

示例2: writeMetaProperties

import org.apache.tinkerpop.gremlin.structure.VertexProperty; //导入方法依赖的package包/类
private static void writeMetaProperties(final VertexProperty property, final JsonGenerator jsonGenerator,
                                        final SerializerProvider serializerProvider,
                                        final TypeSerializer typeSerializer, final boolean normalize) throws IOException {
    jsonGenerator.writeObjectFieldStart(GraphSONTokens.PROPERTIES);
    if (typeSerializer != null) jsonGenerator.writeStringField(GraphSONTokens.CLASS, HashMap.class.getName());
    final Iterator<Property<Object>> metaProperties = normalize ?
            IteratorUtils.list(( Iterator<Property<Object>>) property.properties(), Comparators.PROPERTY_COMPARATOR).iterator() : property.properties();
    while (metaProperties.hasNext()) {
        final Property<Object> metaProperty = metaProperties.next();
        GraphSONUtil.writeWithType(metaProperty.key(), metaProperty.value(), jsonGenerator, serializerProvider, typeSerializer);
    }
    jsonGenerator.writeEndObject();
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:14,代码来源:GraphSONSerializers.java


注:本文中的org.apache.tinkerpop.gremlin.structure.VertexProperty.properties方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。