GitHub user FlorianHockmann opened a pull request:

    https://github.com/apache/tinkerpop/pull/815

    TINKERPOP-1901 Transform enums into classes in Gremlin.Net

    https://issues.apache.org/jira/browse/TINKERPOP-1901
    
    The various Gremlin tokens like `T`, `Order`, and so on are now classes in 
Gremlin.Net so they can implement interfaces which makes them usable in more 
steps.
    
    Using the example from the issue description, the Java step
    ```java
    public default <V> GraphTraversal<S, E> by(final Traversal<?, ?> traversal,
            final Comparator<V> comparator)
    ```
    now has this equivalent in Gremlin.Net:
    ```cs
    public GraphTraversal<S, E> By (ITraversal traversal, IComparator 
comparator)
    ```
    and `Order` implements `IComparator`.
    
    This example already shows that the Gremlin.Net versions of those 
**interfaces aren't generic** which means in practice that they can still be 
used in some places where it shouldn't be possible. Especially `T` implements 
`Function<Element, Object>` in Java, but simply `IFunction` in Gremlin.Net. So 
users can still use `T` for steps that don't take a lambda with an `Element` 
argument. However, this was also possible before as we simply had the `object` 
type in those places before this PR. So I'd say that we tackle that one later.
    
    All tests pass with `docker/build.sh -t -i -d`
    
    VOTE +1

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/tinkerpop TINKERPOP-1901

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/tinkerpop/pull/815.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #815
    
----
commit dcf3da3917a9626d432ef26089bb05c6a15158ed
Author: Florian Hockmann <fh@...>
Date:   2018-03-10T18:17:15Z

    TINKERPOP-1901 Transformed Gremlin.Net enums into classes

commit d012171e97d5d87108eef3d0257a8b859f77de04
Author: Florian Hockmann <fh@...>
Date:   2018-03-10T18:21:46Z

    TINKERPOP-1901 Add interfaces for tokens in Gremlin.Net
    
    These interfaces simply represent their Java counterparts which allows
    to use them as arguments in Gremlin steps.

----


---

Reply via email to