bechbd commented on a change in pull request #1533:
URL: https://github.com/apache/tinkerpop/pull/1533#discussion_r777764046
##########
File path:
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
##########
@@ -2364,14 +2373,58 @@ else if (value instanceof Traversal)
* @since 3.0.0-incubating
*/
public default GraphTraversal<S, E> property(final Object key, final
Object value, final Object... keyValues) {
- return key instanceof VertexProperty.Cardinality ?
- this.property((VertexProperty.Cardinality) key, value, null ==
keyValues ? null : keyValues[0],
+ if (key instanceof VertexProperty.Cardinality) {
+ if (value instanceof Map) { //Handle the property(Cardinality,
Map) signature
+ final Map<Object, Object> map = (Map)value;
+ for (Map.Entry<Object, Object> entry : map.entrySet()) {
+ property(key, entry.getKey(), entry.getValue());
+ }
+ return this;
+ } else {
+ return this.property((VertexProperty.Cardinality) key, value,
null == keyValues ? null : keyValues[0],
keyValues != null && keyValues.length > 1 ?
Arrays.copyOfRange(keyValues, 1,
keyValues.length) :
- new Object[]{}) :
- this.property(null, key, value, keyValues);
+ new Object[]{});
+ }
+ } else { //handles if cardinality is not the first parameter
+ if (value instanceof Map) { //Handle the property(Cardinality,
Map) signature
+ final Map<Object, Object> map = (Map)value;
+ for (Map.Entry<Object, Object> entry : map.entrySet()) {
+ property(null, entry.getKey(), entry.getValue());
+ }
+ return this;
+ } else {
+ return this.property(null, key, value, keyValues);
+ }
+ }
+ }
+
+ /**
+ * When a {@link Map} is supplied and if supported by the {@link Graph}
then each of the key/value pairs in the map will
Review comment:
Yeah, that is a good point, I've removed it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]