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 aTraversalSource
and 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 void
addG(String g)
The alias to set.void
addSource(String sourceName, Object... arguments)
Add aTraversalSource
instruction to the GremlinLang.void
addStep(String stepName, Object... arguments)
Add aTraversal
instruction to the GremlinLang.GremlinLang
clone()
boolean
equals(Object o)
String
getGremlin()
Get gremlin-lang compatible representation of TraversalString
getGremlin(String g)
Get gremlin-lang compatible representation of Traversal.List<org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.OptionsStrategy>
getOptionsStrategies()
Provides a way to get configuration of a Traversal.Map<String,Object>
getParameters()
Get parameters used in Traversal.int
hashCode()
boolean
isEmpty()
void
reset()
Reset parameter naming counter.String
toString()
-
-
-
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 aTraversalSource
instruction 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 aTraversal
instruction to the GremlinLang.- Parameters:
stepName
- the traversal method name (e.g. out())arguments
- the traversal method arguments
-
getOptionsStrategies
public List<org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.OptionsStrategy> getOptionsStrategies()
Provides a way to get configuration of a Traversal.- Returns:
- list of OptionsStrategy
-
isEmpty
public boolean isEmpty()
-
clone
public GremlinLang clone()
-
-