java.lang.Object
org.apache.tinkerpop.gremlin.process.traversal.step.util.Parameters
All Implemented Interfaces:
Serializable, Cloneable

public class Parameters extends Object implements Cloneable, Serializable
The parameters held by a Traversal.
Author:
Marko A. Rodriguez (http://markorodriguez.com), Stephen Mallette (http://stephen.genoprime.com)
See Also:
  • Field Details

  • Constructor Details

    • Parameters

      public Parameters()
  • Method Details

    • contains

      public boolean contains(Object key)
      Checks for existence of key in parameter set.
      Parameters:
      key - the key to check
      Returns:
      true if the key is present and false otherwise
    • contains

      public boolean contains(Object key, Object value)
      Checks for existence of a key and value in a parameter set.
      Parameters:
      key - the key to check
      value - the value to check
      Returns:
      true if the key and value are present and false otherwise
    • size

      public int size()
      Returns the size of parameter set.
      Returns:
      number of parameters (keys)
    • isEmpty

      public boolean isEmpty()
      Check if the parameter set is empty.
      Returns:
      true if the size is zero
    • rename

      public void rename(Object oldKey, Object newKey)
      Renames a key in the parameter set.
      Parameters:
      oldKey - the key to rename
      newKey - the new name of the key
    • get

      public <S, E> List<E> get(Traverser.Admin<S> traverser, Object key, Supplier<E> defaultValue)
      Gets the list of values for a key, while resolving the values of any parameters that are Traversal objects.
    • get

      public <E> List<E> get(Object key, Supplier<E> defaultValue)
      Gets the value of a key and if that key isn't present returns the default value from the Supplier.
      Parameters:
      key - the key to retrieve
      defaultValue - the default value generator which if null will return an empty list
    • remove

      public Object remove(Object key)
      Remove a key from the parameter set.
      Parameters:
      key - the key to remove
      Returns:
      the value of the removed key
    • getKeyValues

      public <S> Object[] getKeyValues(Traverser.Admin<S> traverser, Object... exceptKeys)
      Gets the array of keys/values of the parameters while resolving parameter values that contain Traversal instances.
    • getRaw

      public Map<Object,List<Object>> getRaw(Object... exceptKeys)
      Gets an immutable set of the parameters without evaluating them in the context of a Traverser as is done in getKeyValues(Traverser.Admin, Object...).
      Parameters:
      exceptKeys - keys to not include in the returned Map
    • set

      public void set(TraversalParent parent, Object... keyValues)
      Set parameters given key/value pairs.
    • getTraversals

      public <S, E> List<Traversal.Admin<S,E>> getTraversals()
      Gets all the Traversal.Admin objects in the map of parameters.
    • getReferencedLabels

      public Set<String> getReferencedLabels()
      Gets a list of all labels held in parameters that have a traversal as a value.
    • clone

      public Parameters clone()
      Overrides:
      clone in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object