You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2020/01/09 11:48:06 UTC

[tinkerpop] 11/13: added hashCode() and toString() to FlatMapInitial.

This is an automated email from the ASF dual-hosted git repository.

spmallette pushed a commit to branch 4.0-dev
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit 57dfb646ffbc466f964aaf04bcab9f42b1350c61
Author: Marko A. Rodriguez <ok...@gmail.com>
AuthorDate: Mon Apr 29 16:41:52 2019 -0600

    added hashCode() and toString() to FlatMapInitial.
---
 .../tinkerpop/machine/function/initial/FlatMapInitial.java    | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/java/machine/machine-core/src/main/java/org/apache/tinkerpop/machine/function/initial/FlatMapInitial.java b/java/machine/machine-core/src/main/java/org/apache/tinkerpop/machine/function/initial/FlatMapInitial.java
index 2a2ca21..66afefb 100644
--- a/java/machine/machine-core/src/main/java/org/apache/tinkerpop/machine/function/initial/FlatMapInitial.java
+++ b/java/machine/machine-core/src/main/java/org/apache/tinkerpop/machine/function/initial/FlatMapInitial.java
@@ -22,6 +22,7 @@ import org.apache.tinkerpop.machine.coefficient.Coefficient;
 import org.apache.tinkerpop.machine.function.AbstractFunction;
 import org.apache.tinkerpop.machine.function.InitialFunction;
 import org.apache.tinkerpop.machine.traverser.species.EmptyTraverser;
+import org.apache.tinkerpop.machine.util.StringFactory;
 
 import java.util.Iterator;
 
@@ -41,4 +42,14 @@ public final class FlatMapInitial<C, S> extends AbstractFunction<C> implements I
     public Iterator<S> get() {
         return this.function.apply(EmptyTraverser.instance());
     }
+
+    @Override
+    public int hashCode() {
+        return super.hashCode() ^ this.function.hashCode();
+    }
+
+    @Override
+    public String toString() {
+        return StringFactory.makeFunctionString(this, this.function);
+    }
 }