Class DetachedElement<E>

java.lang.Object
org.apache.tinkerpop.gremlin.structure.util.detached.DetachedElement<E>
All Implemented Interfaces:
Serializable, Element, Attachable<E>
Direct Known Subclasses:
DetachedEdge, DetachedVertex, DetachedVertexProperty

public abstract class DetachedElement<E> extends Object implements Element, Serializable, Attachable<E>
Author:
Stephen Mallette (http://stephen.genoprime.com), Marko A. Rodriguez (http://markorodriguez.com)
See Also:
  • Field Details

  • Constructor Details

    • DetachedElement

      protected DetachedElement()
    • DetachedElement

      protected DetachedElement(Element element)
    • DetachedElement

      protected DetachedElement(Object id, String label)
  • Method Details

    • graph

      public Graph graph()
      Description copied from interface: Element
      Get the graph that this element is within.
      Specified by:
      graph in interface Element
      Returns:
      the graph of this element
    • id

      public Object id()
      Description copied from interface: Element
      Gets the unique identifier for the graph Element.
      Specified by:
      id in interface Element
      Returns:
      The id of the element
    • label

      public String label()
      Description copied from interface: Element
      Gets the label for the graph Element which helps categorize it.
      Specified by:
      label in interface Element
      Returns:
      The label of the element
    • labels

      public Set<String> labels()
      Description copied from interface: Element
      Gets all labels for this element.

      For Vertex: may return zero or more labels (multi-label support). For Edge: returns a singleton set (single label only in TinkerGraph). For VertexProperty: returns a singleton set containing the property key.

      Specified by:
      labels in interface Element
      Returns:
      An unmodifiable Set of labels; may be empty for vertices with no labels
    • property

      public <V> Property<V> property(String key, V value)
      Description copied from interface: Element
      Add or set a property value for the Element given its key.
      Specified by:
      property in interface Element
    • property

      public <V> Property<V> property(String key)
      Description copied from interface: Element
      Get a Property for the Element given its key. The default implementation calls the raw Element.properties(java.lang.String...).
      Specified by:
      property in interface Element
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object
    • properties

      public <V> Iterator<? extends Property<V>> properties(String... propertyKeys)
      Description copied from interface: Element
      Get an Iterator of properties where the propertyKeys is meant to be a filter on the available keys. If no keys are provide then return all the properties.
      Specified by:
      properties in interface Element
    • get

      public E get()
      Description copied from interface: Attachable
      Get the raw object trying to be attached.
      Specified by:
      get in interface Attachable<E>
      Returns:
      the raw object to attach