@@ -43,9 +43,9 @@ public interface Specification<T> extends Serializable {
4343/**
4444 * Negates the given {@link Specification}.
4545 *
46- * @param <T>
46+ * @param <T> the type of the {@link Root} the resulting {@literal Specification} operates on.
4747 * @param spec can be {@literal null}.
48- * @return
48+ * @return guaranteed to be not {@literal null}.
4949 * @since 2.0
5050 */
5151static <T > Specification <T > not (@ Nullable Specification <T > spec ) {
@@ -58,9 +58,9 @@ static <T> Specification<T> not(@Nullable Specification<T> spec) {
5858/**
5959 * Simple static factory method to add some syntactic sugar around a {@link Specification}.
6060 *
61- * @param <T>
61+ * @param <T> the type of the {@link Root} the resulting {@literal Specification} operates on.
6262 * @param spec can be {@literal null}.
63- * @return
63+ * @return guaranteed to be not {@literal null}.
6464 * @since 2.0
6565 */
6666static <T > Specification <T > where (@ Nullable Specification <T > spec ) {
@@ -76,7 +76,7 @@ static <T> Specification<T> where(@Nullable Specification<T> spec) {
7676 */
7777
7878default Specification <T > and (@ Nullable Specification <T > other ) {
79- return composed (this , other , ( builder , left , rhs ) -> builder . and ( left , rhs ) );
79+ return composed (this , other , CriteriaBuilder :: and );
8080}
8181
8282/**
@@ -87,7 +87,7 @@ default Specification<T> and(@Nullable Specification<T> other) {
8787 * @since 2.0
8888 */
8989default Specification <T > or (@ Nullable Specification <T > other ) {
90- return composed (this , other , ( builder , left , rhs ) -> builder . or ( left , rhs ) );
90+ return composed (this , other , CriteriaBuilder :: or );
9191}
9292
9393/**
0 commit comments