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


Java Property.empty方法代码示例

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


在下文中一共展示了Property.empty方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: specificProperty

import org.apache.tinkerpop.gremlin.structure.Property; //导入方法依赖的package包/类
@Override
protected <V> Property<V> specificProperty(String key) {
    // note: usage of `==` (pointer comparison) over `.equals` (String content comparison) is intentional for performance - use the statically defined strings
    if (key == WEIGHT && weight != null) {
        return new TinkerProperty(this, key, weight);
    } else {
        return Property.empty();
    }
}
 
开发者ID:ShiftLeftSecurity,项目名称:tinkergraph-gremlin,代码行数:10,代码来源:FollowedBy.java

示例2: property

import org.apache.tinkerpop.gremlin.structure.Property; //导入方法依赖的package包/类
@Override
public <T> Property<T> property(String key) {
    T value = value(key);
    if (value == null) {
        return Property.<T>empty();
    } else {
        return new BitsyProperty<T>(this, key, value);
    }
}
 
开发者ID:lambdazen,项目名称:bitsy,代码行数:10,代码来源:BitsyElement.java

示例3: sideEffect

import org.apache.tinkerpop.gremlin.structure.Property; //导入方法依赖的package包/类
@Override
protected void sideEffect(final Traverser.Admin<S> traverser) {
    final String key = (String) this.parameters.get(traverser, T.key, () -> {
        throw new IllegalStateException("The AddPropertyStep does not have a provided key: " + this);
    }).get(0);
    final Object value = this.parameters.get(traverser, T.value, () -> {
        throw new IllegalStateException("The AddPropertyStep does not have a provided value: " + this);
    }).get(0);
    final Object[] vertexPropertyKeyValues = this.parameters.getKeyValues(traverser, T.key, T.value);

    final Element element = traverser.get();


    if (this.callbackRegistry != null) {
        final Property currentProperty = traverser.get().property(key);
        final boolean newProperty = element instanceof Vertex ? currentProperty == VertexProperty.empty() : currentProperty == Property.empty();
        final Event.ElementPropertyChangedEvent evt;
        if (element instanceof Vertex)
            evt = new Event.VertexPropertyChangedEvent(DetachedFactory.detach((Vertex) element, true), newProperty ? null : DetachedFactory.detach((VertexProperty) currentProperty, true), value, vertexPropertyKeyValues);
        else if (element instanceof Edge)
            evt = new Event.EdgePropertyChangedEvent(DetachedFactory.detach((Edge) element, true), newProperty ? null : DetachedFactory.detach(currentProperty), value);
        else if (element instanceof VertexProperty)
            evt = new Event.VertexPropertyPropertyChangedEvent(DetachedFactory.detach((VertexProperty) element, true), newProperty ? null : DetachedFactory.detach(currentProperty), value);
        else
            throw new IllegalStateException(String.format("The incoming object cannot be processed by change eventing in %s:  %s", AddPropertyStep.class.getName(), element));

        this.callbackRegistry.getCallbacks().forEach(c -> c.accept(evt));
    }

    if (null != this.cardinality)
        ((Vertex) element).property(this.cardinality, key, value, vertexPropertyKeyValues);
    else if (vertexPropertyKeyValues.length > 0)
        ((Vertex) element).property(key, value, vertexPropertyKeyValues);
    else
        element.property(key, value);
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:37,代码来源:AddPropertyStep.java

示例4: getProperty

import org.apache.tinkerpop.gremlin.structure.Property; //导入方法依赖的package包/类
@Override
public <V> Property<V> getProperty(final Neo4jVertexProperty vertexProperty, final String key) {
    final Neo4jNode vertexPropertyNode = Neo4jHelper.getVertexPropertyNode(vertexProperty);
    if (null != vertexPropertyNode && vertexPropertyNode.hasProperty(key))
        return new Neo4jProperty<>(vertexProperty, key, (V) vertexPropertyNode.getProperty(key));
    else
        return Property.empty();
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:9,代码来源:MultiMetaNeo4jTrait.java

示例5: property

import org.apache.tinkerpop.gremlin.structure.Property; //导入方法依赖的package包/类
@Override
public <V> Property<V> property(final String key) {
    this.graph.tx().readWrite();
    if (this.baseElement.hasProperty(key))
        return new Neo4jProperty<>(this, key, (V) this.baseElement.getProperty(key));
    else
        return Property.empty();
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:9,代码来源:Neo4jEdge.java

示例6: property

import org.apache.tinkerpop.gremlin.structure.Property; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
@SuppressWarnings("unchecked")
public <V> Property<V> property(String key) {
    Objects.requireNonNull(key, "key cannot be null");
    // property value
    Neo4JEdgeProperty propertyValue = properties.get(key);
    if (propertyValue != null)
        return (Property<V>)propertyValue;
    // empty property
    return Property.empty();
}
 
开发者ID:SteelBridgeLabs,项目名称:neo4j-gremlin-bolt,代码行数:15,代码来源:Neo4JEdge.java

示例7: property

import org.apache.tinkerpop.gremlin.structure.Property; //导入方法依赖的package包/类
@Override
public <V> Property<V> property(final String key) {
    return null == this.properties ? Property.<V>empty() : this.properties.getOrDefault(key, Property.<V>empty());
}
 
开发者ID:ShiftLeftSecurity,项目名称:tinkergraph-gremlin,代码行数:5,代码来源:TinkerEdge.java

示例8: property

import org.apache.tinkerpop.gremlin.structure.Property; //导入方法依赖的package包/类
@Override
public <U> Property<U> property(final String key) {
    return null == this.properties ? Property.<U>empty() : this.properties.getOrDefault(key, Property.<U>empty());
}
 
开发者ID:ShiftLeftSecurity,项目名称:tinkergraph-gremlin,代码行数:5,代码来源:TinkerVertexProperty.java

示例9: specificProperty

import org.apache.tinkerpop.gremlin.structure.Property; //导入方法依赖的package包/类
@Override
protected <V> Property<V> specificProperty(String key) {
    return Property.empty();
}
 
开发者ID:ShiftLeftSecurity,项目名称:tinkergraph-gremlin,代码行数:5,代码来源:WrittenBy.java

示例10: property

import org.apache.tinkerpop.gremlin.structure.Property; //导入方法依赖的package包/类
@Override
public <V> Property<V> property(final String key) {
    V value = getProperty(key);
    return value != null ? new HBaseProperty<>(graph, this, key, value) : Property.empty();
}
 
开发者ID:rayokota,项目名称:hgraphdb,代码行数:6,代码来源:HBaseEdge.java

示例11: property

import org.apache.tinkerpop.gremlin.structure.Property; //导入方法依赖的package包/类
@Override
public <V> Property<V> property(final String key) {
    return null != this.properties && this.properties.containsKey(key) ? this.properties.get(key).get(0) : Property.empty();
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:5,代码来源:DetachedElement.java

示例12: property

import org.apache.tinkerpop.gremlin.structure.Property; //导入方法依赖的package包/类
@Override
public <U> Property<U> property(String key) {
    return Property.<U>empty();
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:5,代码来源:EmptyVertexProperty.java


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