本文整理汇总了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();
}
}
示例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);
}
}
示例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);
}
示例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();
}
示例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();
}
示例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();
}
示例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());
}
示例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());
}
示例9: specificProperty
import org.apache.tinkerpop.gremlin.structure.Property; //导入方法依赖的package包/类
@Override
protected <V> Property<V> specificProperty(String key) {
return Property.empty();
}
示例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();
}
示例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();
}
示例12: property
import org.apache.tinkerpop.gremlin.structure.Property; //导入方法依赖的package包/类
@Override
public <U> Property<U> property(String key) {
return Property.<U>empty();
}