TINKERPOP-920 Added more javadoc for getCardinality()

Basically, users shouldn't rely on this method for determining a key's 
cardinality in production applications. This method is generally for internal 
use by TinkerPop (mostly for the test suite and other generalized functions) CTR


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/116205eb
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/116205eb
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/116205eb

Branch: refs/heads/TINKERPOP-1489
Commit: 116205ebc7342ae721cf76992653479a95ad2f0d
Parents: ee05582
Author: Stephen Mallette <[email protected]>
Authored: Tue Jun 20 12:24:39 2017 -0400
Committer: Stephen Mallette <[email protected]>
Committed: Tue Jun 20 12:31:17 2017 -0400

----------------------------------------------------------------------
 .../main/java/org/apache/tinkerpop/gremlin/structure/Graph.java | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/116205eb/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java
----------------------------------------------------------------------
diff --git 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java
index 1f59719..81bbed7 100644
--- 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java
+++ 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java
@@ -525,6 +525,11 @@ public interface Graph extends AutoCloseable, Host {
              * {@link VertexProperty.Cardinality#list}.  Implementations that 
employ a schema can consult it to
              * determine the {@link VertexProperty.Cardinality}.  Those that 
do no have a schema can return their
              * default {@link VertexProperty.Cardinality} for every key.
+             * <p/>
+             * Note that this method is primarily used by TinkerPop for 
internal usage and may not be suitable to
+             * reliably determine the cardinality of a key. For some 
implementation it may offer little more than a
+             * hint on the actual cardinality. Generally speaking it is likely 
best to drop down to the API of the
+             * {@link Graph} implementation for any schema related queries.
              */
             public default VertexProperty.Cardinality getCardinality(final 
String key) {
                 return VertexProperty.Cardinality.list;

Reply via email to