File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed
src/main/java/org/mybatis/dynamic/sql Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change
1
+ #
2
+ # Copyright 2016-2020 the original author or authors.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
1
17
version : 2
2
18
updates :
3
19
- package-ecosystem : maven
Original file line number Diff line number Diff line change 15
15
*/
16
16
package org .mybatis .dynamic .sql ;
17
17
18
- import java .util .ArrayList ;
19
18
import java .util .Collection ;
20
19
import java .util .Objects ;
21
20
import java .util .function .Function ;
22
21
import java .util .function .UnaryOperator ;
22
+ import java .util .stream .Collectors ;
23
23
import java .util .stream .Stream ;
24
24
25
25
public abstract class AbstractListValueCondition <T > implements VisitableCondition <T > {
@@ -32,12 +32,13 @@ protected AbstractListValueCondition(Collection<T> values) {
32
32
}
33
33
34
34
protected AbstractListValueCondition (Collection <T > values , UnaryOperator <Stream <T >> valueStreamTransformer ) {
35
- this .values = new ArrayList <>(Objects .requireNonNull (values ));
36
35
this .valueStreamTransformer = Objects .requireNonNull (valueStreamTransformer );
36
+ this .values = valueStreamTransformer .apply (Objects .requireNonNull (values ).stream ())
37
+ .collect (Collectors .toList ());
37
38
}
38
39
39
40
public final <R > Stream <R > mapValues (Function <T , R > mapper ) {
40
- return valueStreamTransformer . apply ( values .stream () ).map (mapper );
41
+ return values .stream ().map (mapper );
41
42
}
42
43
43
44
@ Override
You can’t perform that action at this time.
0 commit comments