org.apache.tinkerpop.gremlin.process.traversal.translator

## Class GroovyTranslator.LanguageTypeTranslator

- java.lang.Object
- - org.apache.tinkerpop.gremlin.process.traversal.Translator.ScriptTranslator.AbstractTypeTranslator
  - - org.apache.tinkerpop.gremlin.process.traversal.translator.GroovyTranslator.DefaultTypeTranslator
    - - org.apache.tinkerpop.gremlin.process.traversal.translator.GroovyTranslator.LanguageTypeTranslator

- All Implemented Interfaces:
    BiFunction<String,Object,Script>, Translator.ScriptTranslator.TypeTranslator
  Enclosing class:
    GroovyTranslator

      public static class GroovyTranslator.LanguageTypeTranslator
      extends GroovyTranslator.DefaultTypeTranslator

  An extension of the `GroovyTranslator.DefaultTypeTranslator` that generates Gremlin that is compliant with `gremlin-language` scripts. Specifically, it will convert `Date` and `Timestamp` to use the `datetime()` function. Time zone offsets are resolved to where `2018-03-22T00:35:44.741+1600` would be converted to `datetime('2018-03-21T08:35:44.741Z')`. More commonly `2018-03-22` would simply generate `datetime('2018-03-22T00:00:00Z')`.

- - ### Field Summary

    - ### Fields inherited from class org.apache.tinkerpop.gremlin.process.traversal.Translator.ScriptTranslator.AbstractTypeTranslator

      `ANONYMOUS_TRAVERSAL_PREFIX, script, withParameters`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LanguageTypeTranslator(boolean withParameters)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected String` | `getSyntax(Date o)` Take the `Date` argument and convert it to a string representation in the target language.
    `protected String` | `getSyntax(Timestamp o)` Take the `Timestamp` argument and convert it to a string representation in the target language.

    - ### Methods inherited from class org.apache.tinkerpop.gremlin.process.traversal.translator.GroovyTranslator.DefaultTypeTranslator

      `getNullSyntax, getSyntax, getSyntax, getSyntax, getSyntax, getSyntax, getSyntax, getSyntax, getSyntax, produceScript, produceScript, produceScript, produceScript, produceScript, produceScript, produceScript, produceScript, produceScript, produceScript, produceScript`

    - ### Methods inherited from class org.apache.tinkerpop.gremlin.process.traversal.Translator.ScriptTranslator.AbstractTypeTranslator

      `apply, convertToScript, getAnonymousTraversalPrefix`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface java.util.function.BiFunction

      `andThen`

- - ### Constructor Detail

    - #### LanguageTypeTranslator

          public LanguageTypeTranslator(boolean withParameters)

  - ### Method Detail

    - #### getSyntax

          protected String getSyntax(Date o)

      Description copied from class: `Translator.ScriptTranslator.AbstractTypeTranslator`
      Take the `Date` argument and convert it to a string representation in the target language.
      Overrides:
        `getSyntax` in class `GroovyTranslator.DefaultTypeTranslator`

    - #### getSyntax

          protected String getSyntax(Timestamp o)

      Description copied from class: `Translator.ScriptTranslator.AbstractTypeTranslator`
      Take the `Timestamp` argument and convert it to a string representation in the target language.
      Overrides:
        `getSyntax` in class `GroovyTranslator.DefaultTypeTranslator`

Copyright © 2013–2022 Apache Software Foundation. All rights reserved.