From afd76f8937d8bb22e83cd98742f02cf419b921b5 Mon Sep 17 00:00:00 2001 From: Jens Schauder Date: Wed, 6 Nov 2019 11:00:35 +0100 Subject: [PATCH] DATAJPA-1622 - Polishing. Added documentation and replaced lambdas with method references. Original pull request: #397. --- .../data/jpa/domain/Specification.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/springframework/data/jpa/domain/Specification.java b/src/main/java/org/springframework/data/jpa/domain/Specification.java index 8e1d9a601..113d3a270 100644 --- a/src/main/java/org/springframework/data/jpa/domain/Specification.java +++ b/src/main/java/org/springframework/data/jpa/domain/Specification.java @@ -43,9 +43,9 @@ public interface Specification extends Serializable { /** * Negates the given {@link Specification}. * - * @param + * @param the type of the {@link Root} the resulting {@literal Specification} operates on. * @param spec can be {@literal null}. - * @return + * @return guaranteed to be not {@literal null}. * @since 2.0 */ static Specification not(@Nullable Specification spec) { @@ -58,9 +58,9 @@ public interface Specification extends Serializable { /** * Simple static factory method to add some syntactic sugar around a {@link Specification}. * - * @param + * @param the type of the {@link Root} the resulting {@literal Specification} operates on. * @param spec can be {@literal null}. - * @return + * @return guaranteed to be not {@literal null}. * @since 2.0 */ static Specification where(@Nullable Specification spec) { @@ -76,7 +76,7 @@ public interface Specification extends Serializable { */ default Specification and(@Nullable Specification other) { - return composed(this, other, (builder, left, rhs) -> builder.and(left, rhs)); + return composed(this, other, CriteriaBuilder::and); } /** @@ -87,7 +87,7 @@ public interface Specification extends Serializable { * @since 2.0 */ default Specification or(@Nullable Specification other) { - return composed(this, other, (builder, left, rhs) -> builder.or(left, rhs)); + return composed(this, other, CriteriaBuilder::or); } /**