Class Parameters
java.lang.Object
org.apache.tinkerpop.gremlin.process.traversal.step.util.Parameters
- All Implemented Interfaces:
Serializable,Cloneable
The parameters held by a
Traversal.- Author:
- Marko A. Rodriguez (http://markorodriguez.com), Stephen Mallette (http://stephen.genoprime.com)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Parametersprotected List<Traversal.Admin<?,?>> A cached list of traversals that serve as parameter values. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()booleanChecks for existence of key in parameter set.booleanChecks for existence of a key and value in a parameter set.boolean<E> List<E>Gets the value of a key and if that key isn't present returns the default value from theSupplier.<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 areTraversalobjects.<S> Object[]getKeyValues(Traverser.Admin<S> traverser, Object... exceptKeys) Gets the array of keys/values of the parameters while resolving parameter values that containTraversalinstances.Gets an immutable set of the parameters without evaluating them in the context of aTraverseras is done ingetKeyValues(Traverser.Admin, Object...).Gets a list of all labels held in parameters that have a traversal as a value.<S,E> List<Traversal.Admin<S, E>> Gets all theTraversal.Adminobjects in the map of parameters.inthashCode()booleanisEmpty()Check if the parameter set is empty.Remove a key from the parameter set.voidRenames a key in the parameter set.voidset(TraversalParent parent, Object... keyValues) Set parameters given key/value pairs.intsize()Returns the size of parameter set.toString()
-
Field Details
-
EMPTY
-
parameters
-
referencedLabels
-
traversals
A cached list of traversals that serve as parameter values. The list is cached on calls toset(TraversalParent, Object...)because when the parameter map is large the cost of iterating it repeatedly on the high number of calls togetTraversals()is great.
-
-
Constructor Details
-
Parameters
public Parameters()
-
-
Method Details
-
contains
Checks for existence of key in parameter set.- Parameters:
key- the key to check- Returns:
trueif the key is present andfalseotherwise
-
contains
Checks for existence of a key and value in a parameter set.- Parameters:
key- the key to checkvalue- the value to check- Returns:
trueif the key and value are present andfalseotherwise
-
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:
trueif the size is zero
-
rename
Renames a key in the parameter set.- Parameters:
oldKey- the key to renamenewKey- the new name of the key
-
get
Gets the list of values for a key, while resolving the values of any parameters that areTraversalobjects. -
get
Gets the value of a key and if that key isn't present returns the default value from theSupplier.- Parameters:
key- the key to retrievedefaultValue- the default value generator which if null will return an empty list
-
remove
Remove a key from the parameter set.- Parameters:
key- the key to remove- Returns:
- the value of the removed key
-
getKeyValues
Gets the array of keys/values of the parameters while resolving parameter values that containTraversalinstances. -
getRaw
Gets an immutable set of the parameters without evaluating them in the context of aTraverseras is done ingetKeyValues(Traverser.Admin, Object...).- Parameters:
exceptKeys- keys to not include in the returnedMap
-
set
Set parameters given key/value pairs. -
getTraversals
Gets all theTraversal.Adminobjects in the map of parameters. -
getReferencedLabels
Gets a list of all labels held in parameters that have a traversal as a value. -
clone
-
equals
-
hashCode
public int hashCode() -
toString
-