Class GremlinLang
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.process.traversal.GremlinLang
-
- All Implemented Interfaces:
Serializable,Cloneable
public class GremlinLang extends Object implements Cloneable, Serializable
This class helps to build a gremlin-lang compatible string representation based on aTraversalSourceand then aTraversal.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description GremlinLang()GremlinLang(String sourceName, Object... arguments)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddG(String g)The alias to set.voidaddSource(String sourceName, Object... arguments)Add aTraversalSourceinstruction to the GremlinLang.voidaddStep(String stepName, Object... arguments)Add aTraversalinstruction to the GremlinLang.GremlinLangclone()booleanequals(Object o)StringgetGremlin()Get gremlin-lang compatible representation of TraversalStringgetGremlin(String g)Get gremlin-lang compatible representation of Traversal.List<OptionsStrategy>getOptionsStrategies()Provides a way to get configuration of a Traversal.Map<String,Object>getParameters()Get parameters used in Traversal.inthashCode()booleanisEmpty()voidreset()Reset parameter naming counter.StringtoString()
-
-
-
Method Detail
-
getGremlin
public String getGremlin()
Get gremlin-lang compatible representation of Traversal- Returns:
- gremlin-lang compatible String
-
getGremlin
public String getGremlin(String g)
Get gremlin-lang compatible representation of Traversal. "g" is expected for gremlin-lang. "__" can be used for an anonymousGraphTraversal.- Parameters:
g- GraphTraversalSource name- Returns:
- gremlin-lang compatible String
-
getParameters
public Map<String,Object> getParameters()
Get parameters used in Traversal.- Returns:
- parameters Map
-
addG
public void addG(String g)
The alias to set.
-
reset
public void reset()
Reset parameter naming counter. Mainly intended to make testing easier
-
addSource
public void addSource(String sourceName, Object... arguments)
Add aTraversalSourceinstruction to the GremlinLang.- Parameters:
sourceName- the traversal source method name (e.g. withSack())arguments- the traversal source method arguments
-
addStep
public void addStep(String stepName, Object... arguments)
Add aTraversalinstruction to the GremlinLang.- Parameters:
stepName- the traversal method name (e.g. out())arguments- the traversal method arguments
-
getOptionsStrategies
public List<OptionsStrategy> getOptionsStrategies()
Provides a way to get configuration of a Traversal.- Returns:
- list of OptionsStrategy
-
isEmpty
public boolean isEmpty()
-
clone
public GremlinLang clone()
-
-