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

Convert InsertOperationTest to use native CQL not validating Bridge #684

Merged
merged 15 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;

/**
* Utility class for methods used to convert from Java types to CQL types, for use in CQL bind
* values.
*/
public class CQLBindValues {

public static Map<String, Integer> getIntegerMapValues(Map<JsonPath, Integer> from) {
Expand All @@ -31,10 +36,10 @@ public static Set<String> getSetValue(Set<JsonPath> from) {
}

public static Set<String> getStringSetValue(Set<String> from) {
return from.stream().map(val -> val.toString()).collect(Collectors.toSet());
return new LinkedHashSet<>(from);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No point calling String.toString() or using stream operation; if we want a copy create directly.
But caller probably shouldn't need to call this method at all TBH.

}

public static List<String> getListValue(List<JsonPath> from) {
public static List<String> getListValue(List<?> from) {
tatu-at-datastax marked this conversation as resolved.
Show resolved Hide resolved
return from.stream().map(val -> val.toString()).collect(Collectors.toList());
}

Expand Down
Loading