Browse Source

Convert Vavr Seq to list with asJava method.

asJava(…) creates a read-only view instead of copying elements into a new List.

Closes #2217
Original pull request: #287
pull/2285/head
Valeriy.Vyrva 8 years ago committed by Mark Paluch
parent
commit
b2fe6d3d22
No known key found for this signature in database
GPG Key ID: 4406B84C1661DCD1
  1. 4
      src/main/java/org/springframework/data/repository/util/VavrCollections.java

4
src/main/java/org/springframework/data/repository/util/VavrCollections.java

@ -60,7 +60,7 @@ class VavrCollections { @@ -60,7 +60,7 @@ class VavrCollections {
public Object convert(Object source) {
if (source instanceof io.vavr.collection.Seq) {
return ((io.vavr.collection.Seq<?>) source).toJavaList();
return ((io.vavr.collection.Seq<?>) source).asJava();
}
if (source instanceof io.vavr.collection.Map) {
@ -71,7 +71,7 @@ class VavrCollections { @@ -71,7 +71,7 @@ class VavrCollections {
return ((io.vavr.collection.Set<?>) source).toJavaSet();
}
throw new IllegalArgumentException("Unsupported Javaslang collection " + source.getClass());
throw new IllegalArgumentException("Unsupported Vavr collection " + source.getClass());
}
}

Loading…
Cancel
Save