Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for Map argument #69

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/main/java/com/falkordb/impl/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,22 @@
List<Object> list = (List<Object>) value;
return arrayToString(list.toArray());
}

if(value instanceof Map){
@SuppressWarnings("unchecked")
Map<Object, Object> map = (Map<Object, Object>) value;
StringBuilder sb = new StringBuilder().append('{');

Check warning on line 91 in src/main/java/com/falkordb/impl/Utils.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/falkordb/impl/Utils.java#L90-L91

Added lines #L90 - L91 were not covered by tests
for(Map.Entry<Object, Object> entry : map.entrySet()) {
sb.append(valueToString(entry.getKey())).append(':').append(valueToString(entry.getValue())).append(",");
}

Check warning on line 94 in src/main/java/com/falkordb/impl/Utils.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/falkordb/impl/Utils.java#L93-L94

Added lines #L93 - L94 were not covered by tests
// remove last comma
if(sb.length() > 1) {
sb.setLength(sb.length() - 1);

Check warning on line 97 in src/main/java/com/falkordb/impl/Utils.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/falkordb/impl/Utils.java#L97

Added line #L97 was not covered by tests
}
sb.append('}');
return sb.toString();

Check warning on line 100 in src/main/java/com/falkordb/impl/Utils.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/falkordb/impl/Utils.java#L99-L100

Added lines #L99 - L100 were not covered by tests
}

return value.toString();
}

Expand Down