Class TinkerVertexProperty<V>
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerElement
-
- org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerVertexProperty<V>
-
- All Implemented Interfaces:
Element
,Property<V>
,VertexProperty<V>
public class TinkerVertexProperty<V> extends TinkerElement implements VertexProperty<V>
- Author:
- Marko A. Rodriguez (http://markorodriguez.com)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.structure.Element
Element.Exceptions
-
Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.structure.VertexProperty
VertexProperty.Cardinality, VertexProperty.Exceptions
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,Property>
properties
-
Fields inherited from class org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerElement
currentVersion, id, label, removed
-
Fields inherited from interface org.apache.tinkerpop.gremlin.structure.VertexProperty
DEFAULT_LABEL
-
-
Constructor Summary
Constructors Constructor Description TinkerVertexProperty(Object id, TinkerVertex vertex, String key, V value, Object... propertyKeyValues)
Use this constructor to constructVertexProperty
instances forTinkerGraph
where theid
can be explicitly set and validated against the expected data type.TinkerVertexProperty(TinkerVertex vertex, String key, V value, Object... propertyKeyValues)
This constructor will not validate the ID type against theGraph
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
clone()
TinkerVertexProperty
copy(TinkerVertex newOwner)
Vertex
element()
Gets theVertex
that owns thisVertexProperty
.boolean
equals(Object object)
Object
id()
Gets the unique identifier for the graphElement
.boolean
isPresent()
Whether the property is empty or not.String
key()
The key of the property.Set<String>
keys()
Get the keys of the properties associated with this element.<U> Iterator<Property<U>>
properties(String... propertyKeys)
Get anIterator
of properties where thepropertyKeys
is meant to be a filter on the available keys.<U> Property<U>
property(String key)
Get aProperty
for theElement
given its key.<U> Property<U>
property(String key, U value)
Add or set a property value for theElement
given its key.void
remove()
Remove the property from the associated element.String
toString()
V
value()
The value of the property.-
Methods inherited from class org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerElement
elementAlreadyRemoved, hashCode, label, version
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.tinkerpop.gremlin.structure.Property
ifPresent, orElse, orElseGet, orElseThrow
-
Methods inherited from interface org.apache.tinkerpop.gremlin.structure.VertexProperty
graph, label
-
-
-
-
Constructor Detail
-
TinkerVertexProperty
public TinkerVertexProperty(TinkerVertex vertex, String key, V value, Object... propertyKeyValues)
This constructor will not validate the ID type against theGraph
. It will always just use aLong
for its identifier. This is useful for constructing aVertexProperty
for usage withTinkerGraphComputerView
.
-
TinkerVertexProperty
public TinkerVertexProperty(Object id, TinkerVertex vertex, String key, V value, Object... propertyKeyValues)
Use this constructor to constructVertexProperty
instances forTinkerGraph
where theid
can be explicitly set and validated against the expected data type.
-
-
Method Detail
-
isPresent
public boolean isPresent()
Description copied from interface:Property
Whether the property is empty or not.
-
clone
public Object clone()
- Specified by:
clone
in classTinkerElement
-
copy
public TinkerVertexProperty copy(TinkerVertex newOwner)
-
id
public Object id()
Description copied from interface:Element
Gets the unique identifier for the graphElement
.- Specified by:
id
in interfaceElement
- Overrides:
id
in classTinkerElement
- Returns:
- The id of the element
-
equals
public boolean equals(Object object)
- Overrides:
equals
in classTinkerElement
-
keys
public Set<String> keys()
Description copied from interface:Element
Get the keys of the properties associated with this element. The default implementation iterators the properties and stores the keys into aHashSet
.
-
property
public <U> Property<U> property(String key)
Description copied from interface:Element
Get aProperty
for theElement
given its key. The default implementation calls the rawElement.properties(java.lang.String...)
.
-
property
public <U> Property<U> property(String key, U value)
Description copied from interface:Element
Add or set a property value for theElement
given its key.
-
element
public Vertex element()
Description copied from interface:VertexProperty
Gets theVertex
that owns thisVertexProperty
.- Specified by:
element
in interfaceProperty<V>
- Specified by:
element
in interfaceVertexProperty<V>
- Returns:
- The element associated with this property (i.e.
Vertex
,Edge
, orVertexProperty
).
-
remove
public void remove()
Description copied from interface:Property
Remove the property from the associated element.
-
properties
public <U> Iterator<Property<U>> properties(String... propertyKeys)
Description copied from interface:VertexProperty
Get anIterator
of properties where thepropertyKeys
is meant to be a filter on the available keys. If no keys are provide then return all the properties.- Specified by:
properties
in interfaceElement
- Specified by:
properties
in interfaceVertexProperty<V>
-
-