Interface TypeResolver

All Known Implementing Classes:
PolymorphicTypeResolver, UntypedTypeResolver

public interface TypeResolver
Type resolvers resolve the frame type from the element being requested and may optionally store metadata about the frame type on the element.
  • Method Summary

    Modifier and Type Method Description
    void deinit​(org.apache.tinkerpop.gremlin.structure.Element element)
    Called to remove the type resolution properties from an element
    <P extends org.apache.tinkerpop.gremlin.structure.Element,​ T extends org.apache.tinkerpop.gremlin.structure.Element>
    org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal<P,​T>
    hasNotType​(org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal<P,​T> traverser, Class<?> type)
    Filters out the objects on the traversal that are not satisfying a requested type.
    <P extends org.apache.tinkerpop.gremlin.structure.Element,​ T extends org.apache.tinkerpop.gremlin.structure.Element>
    org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal<P,​T>
    hasType​(org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal<P,​T> traverser, Class<?> type)
    Filters the objects on the traversal that satisfy a requested type.
    void init​(org.apache.tinkerpop.gremlin.structure.Element element, Class<?> kind)
    Called to initialize an element with type resolution properties.
    Class<?> resolve​(org.apache.tinkerpop.gremlin.structure.Element element)
    Resolve the type of frame that a an element should be.
    <T> Class<? extends T> resolve​(org.apache.tinkerpop.gremlin.structure.Element element, Class<T> kind)
    Resolve the type of frame that a an element should be.
  • Method Details

    • resolve

      <T> Class<? extends T> resolve​(org.apache.tinkerpop.gremlin.structure.Element element, Class<T> kind)
      Resolve the type of frame that a an element should be.
      Type Parameters:
      T - The type used to frame the element.
      Parameters:
      element - The element that is being framed.
      kind - The kind of frame that is being requested by the client code.
      Returns:
      The kind of frame
    • resolve

      Class<?> resolve​(org.apache.tinkerpop.gremlin.structure.Element element)
      Resolve the type of frame that a an element should be.
      Parameters:
      element - The element that is being framed.
      Returns:
      The kind of frame, null if no type resolution properties exist.
    • init

      void init​(org.apache.tinkerpop.gremlin.structure.Element element, Class<?> kind)
      Called to initialize an element with type resolution properties.
      Parameters:
      element - The element that was created.
      kind - The kind of frame that was resolved.
    • deinit

      void deinit​(org.apache.tinkerpop.gremlin.structure.Element element)
      Called to remove the type resolution properties from an element
      Parameters:
      element - The element to remove the property from.
    • hasType

      <P extends org.apache.tinkerpop.gremlin.structure.Element,​ T extends org.apache.tinkerpop.gremlin.structure.Element> org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal<P,​T> hasType​(org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal<P,​T> traverser, Class<?> type)
      Filters the objects on the traversal that satisfy a requested type.
      Type Parameters:
      P - Previous type in the graph traversal
      T - Current type in the graph traversal
      Parameters:
      traverser - A traversal pointing to the current set of vertex to be filtered
      type - The type to filter by.
      Returns:
      The traversal stream filtered by the desired type.
    • hasNotType

      <P extends org.apache.tinkerpop.gremlin.structure.Element,​ T extends org.apache.tinkerpop.gremlin.structure.Element> org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal<P,​T> hasNotType​(org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal<P,​T> traverser, Class<?> type)
      Filters out the objects on the traversal that are not satisfying a requested type.
      Type Parameters:
      P - Previous type in the graph traversal
      T - Current type in the graph traversal
      Parameters:
      traverser - A traversal pointing to the current set of vertex to be filtered
      type - The type to filter by.
      Returns:
      The traversal stream filtered by the desired type.