DATACMNS-1141 - Add missing NonNullApi and Nullable annotations.

Add Nullable annotation to ParsingUtils, Sort.Order and PropertyValueProvider.

Add getRequiredAnnotation(…) to PersistentEntity and PersistentProperty to provide methods returning required, non-null annotations.
This commit is contained in:
Mark Paluch
2017-08-22 10:24:23 +02:00
parent d657b17e74
commit 3a2b6b601b
7 changed files with 90 additions and 10 deletions

View File

@@ -414,7 +414,7 @@ public class Sort implements Streamable<org.springframework.data.domain.Sort.Ord
* @param direction can be {@literal null}, will default to {@link Sort#DEFAULT_DIRECTION}
* @param property must not be {@literal null} or empty.
*/
public Order(Direction direction, String property) {
public Order(@Nullable Direction direction, String property) {
this(direction, property, DEFAULT_IGNORE_CASE, DEFAULT_NULL_HANDLING);
}
@@ -426,7 +426,7 @@ public class Sort implements Streamable<org.springframework.data.domain.Sort.Ord
* @param property must not be {@literal null} or empty.
* @param nullHandling must not be {@literal null}.
*/
public Order(Direction direction, String property, NullHandling nullHandlingHint) {
public Order(@Nullable Direction direction, String property, NullHandling nullHandlingHint) {
this(direction, property, DEFAULT_IGNORE_CASE, nullHandlingHint);
}
@@ -485,7 +485,7 @@ public class Sort implements Streamable<org.springframework.data.domain.Sort.Ord
* @param nullHandling must not be {@literal null}.
* @since 1.7
*/
private Order(Direction direction, String property, boolean ignoreCase, NullHandling nullHandling) {
private Order(@Nullable Direction direction, String property, boolean ignoreCase, NullHandling nullHandling) {
if (!StringUtils.hasText(property)) {
throw new IllegalArgumentException("Property must not null or empty!");