Skip to content

Commit 4adf2e3

Browse files
committed
Polishing.
Add type parameters to Javadoc, remove final keywords, rewording. See #4035
1 parent 472a359 commit 4adf2e3

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

spring-data-jpa/src/main/java/org/springframework/data/jpa/domain/DeleteSpecification.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
* {@link Predicate} or {@literal null}. Specifications returning {@literal null}, such as {@link #unrestricted()}, are
4242
* considered to not contribute to the overall predicate, and their result is not considered in the final predicate.
4343
*
44+
* @param <T> the type of the {@link Root entity} to which the specification is applied.
4445
* @author Mark Paluch
4546
* @author Peter Aisher
4647
* @since 4.0

spring-data-jpa/src/main/java/org/springframework/data/jpa/domain/Specification.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
* {@link Predicate} or {@literal null}. Specifications returning {@literal null}, such as {@link #unrestricted()}, are
4242
* considered to not contribute to the overall predicate, and their result is not considered in the final predicate.
4343
*
44+
* @param <T> the type of the {@link Root entity} to which the specification is applied.
4445
* @author Oliver Gierke
4546
* @author Thomas Darimont
4647
* @author Krzysztof Rzymkowski

spring-data-jpa/src/main/java/org/springframework/data/jpa/domain/UpdateSpecification.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
* {@link Predicate} or {@literal null}. Specifications returning {@literal null}, such as {@link #unrestricted()}, are
4242
* considered to not contribute to the overall predicate, and their result is not considered in the final predicate.
4343
*
44+
* @param <T> the type of the {@link Root entity} to which the specification is applied.
4445
* @author Mark Paluch
4546
* @author Peter Aisher
4647
* @since 4.0

spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/UserSpecifications.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,27 @@
2626
*/
2727
public class UserSpecifications {
2828

29-
public static PredicateSpecification<User> userHasFirstname(final String firstname) {
29+
public static PredicateSpecification<User> userHasFirstname(String firstname) {
3030

3131
return simplePropertySpec("firstname", firstname);
3232
}
3333

34-
public static PredicateSpecification<User> userHasLastname(final String lastname) {
34+
public static PredicateSpecification<User> userHasLastname(String lastname) {
3535

3636
return simplePropertySpec("lastname", lastname);
3737
}
3838

39-
public static PredicateSpecification<User> userHasFirstnameLike(final String expression) {
39+
public static PredicateSpecification<User> userHasFirstnameLike(String expression) {
4040

4141
return (root, cb) -> cb.like(root.get("firstname").as(String.class), String.format("%%%s%%", expression));
4242
}
4343

44-
public static PredicateSpecification<User> userHasAgeLess(final Integer age) {
44+
public static PredicateSpecification<User> userHasAgeLess(Integer age) {
4545

4646
return (root, cb) -> cb.lessThan(root.get("age").as(Integer.class), age);
4747
}
4848

49-
public static Specification<User> userHasLastnameLikeWithSort(final String expression) {
49+
public static Specification<User> userHasLastnameLikeWithSort(String expression) {
5050

5151
return (root, query, cb) -> {
5252

@@ -56,8 +56,8 @@ public static Specification<User> userHasLastnameLikeWithSort(final String expre
5656
};
5757
}
5858

59-
private static <T> PredicateSpecification<T> simplePropertySpec(final String property, final Object value) {
59+
private static <T> PredicateSpecification<T> simplePropertySpec(String property, Object value) {
6060

61-
return (root, builder) -> builder.equal(root.get(property), value);
61+
return (from, builder) -> builder.equal(from.get(property), value);
6262
}
6363
}

0 commit comments

Comments
 (0)