32
32
* Gateway to {@literal array} aggregation operations.
33
33
*
34
34
* @author Christoph Strobl
35
+ * @author Mark Paluch
35
36
* @since 1.0
36
37
*/
37
38
public class ArrayOperators {
@@ -224,15 +225,10 @@ public ReverseArray reverse() {
224
225
* @param expression must not be {@literal null}.
225
226
* @return
226
227
*/
227
- public ArrayOperatorFactory .ReduceInitialValueBuilder reduce (final AggregationExpression expression ) {
228
- return new ArrayOperatorFactory .ReduceInitialValueBuilder () {
228
+ public ArrayOperatorFactory .ReduceInitialValueBuilder reduce (AggregationExpression expression ) {
229
229
230
- @ Override
231
- public Reduce startingWith (Object initialValue ) {
232
- return (usesFieldRef () ? Reduce .arrayOf (fieldReference )
233
- : Reduce .arrayOf (ArrayOperatorFactory .this .expression )).withInitialValue (initialValue ).reduce (expression );
234
- }
235
- };
230
+ return initialValue -> (usesFieldRef () ? Reduce .arrayOf (fieldReference )
231
+ : Reduce .arrayOf (ArrayOperatorFactory .this .expression )).withInitialValue (initialValue ).reduce (expression );
236
232
}
237
233
238
234
/**
@@ -242,16 +238,10 @@ public Reduce startingWith(Object initialValue) {
242
238
* @param expressions
243
239
* @return
244
240
*/
245
- public ArrayOperatorFactory .ReduceInitialValueBuilder reduce (final PropertyExpression ... expressions ) {
246
-
247
- return new ArrayOperatorFactory .ReduceInitialValueBuilder () {
241
+ public ArrayOperatorFactory .ReduceInitialValueBuilder reduce (PropertyExpression ... expressions ) {
248
242
249
- @ Override
250
- public Reduce startingWith (Object initialValue ) {
251
- return (usesFieldRef () ? Reduce .arrayOf (fieldReference ) : Reduce .arrayOf (expression ))
252
- .withInitialValue (initialValue ).reduce (expressions );
253
- }
254
- };
243
+ return initialValue -> (usesFieldRef () ? Reduce .arrayOf (fieldReference ) : Reduce .arrayOf (expression ))
244
+ .withInitialValue (initialValue ).reduce (expressions );
255
245
}
256
246
257
247
/**
0 commit comments