Skip to content

Commit 9674d83

Browse files
committed
DATACMNS-1496 - Removed deprecations at least introduced in Lovelace.
1 parent 78e635f commit 9674d83

37 files changed

+56
-1882
lines changed

src/main/java/org/springframework/data/authentication/UserCredentials.java

-165
This file was deleted.

src/main/java/org/springframework/data/authentication/package-info.java

-5
This file was deleted.

src/main/java/org/springframework/data/domain/ExampleMatcher.java

+1-25
Original file line numberDiff line numberDiff line change
@@ -560,19 +560,7 @@ enum StringMatcher {
560560
/**
561561
* Allows to transform the property value before it is used in the query.
562562
*/
563-
interface PropertyValueTransformer extends Function<Optional<Object>, Optional<Object>> {
564-
565-
/**
566-
* For backwards compatibility of clients used to invoke Spring's Converter interface.
567-
*
568-
* @param source
569-
* @return
570-
*/
571-
@Deprecated
572-
default Object convert(Object source) {
573-
return apply(Optional.ofNullable(source)).orElse(null);
574-
}
575-
}
563+
interface PropertyValueTransformer extends Function<Optional<Object>, Optional<Object>> {}
576564

577565
/**
578566
* @author Christoph Strobl
@@ -699,18 +687,6 @@ public PropertyValueTransformer getPropertyValueTransformer() {
699687
return valueTransformer == null ? NoOpPropertyValueTransformer.INSTANCE : valueTransformer;
700688
}
701689

702-
/**
703-
* Transforms a given source using the {@link PropertyValueTransformer}.
704-
*
705-
* @param source
706-
* @return
707-
* @deprecated since 2.0, use {@link #transformValue(Optional)} instead.
708-
*/
709-
@Deprecated
710-
public Object transformValue(Object source) {
711-
return transformValue(Optional.ofNullable(source)).orElse(null);
712-
}
713-
714690
/**
715691
* Transforms a given source using the {@link PropertyValueTransformer}.
716692
*

src/main/java/org/springframework/data/domain/PageRequest.java

+6-32
Original file line numberDiff line numberDiff line change
@@ -30,43 +30,14 @@ public class PageRequest extends AbstractPageRequest {
3030

3131
private final Sort sort;
3232

33-
/**
34-
* Creates a new {@link PageRequest}. Pages are zero indexed, thus providing 0 for {@code page} will return the first
35-
* page.
36-
*
37-
* @param page zero-based page index.
38-
* @param size the size of the page to be returned.
39-
* @deprecated use {@link #of(int, int)} instead.
40-
*/
41-
@Deprecated
42-
public PageRequest(int page, int size) {
43-
this(page, size, Sort.unsorted());
44-
}
45-
46-
/**
47-
* Creates a new {@link PageRequest} with sort parameters applied.
48-
*
49-
* @param page zero-based page index.
50-
* @param size the size of the page to be returned.
51-
* @param direction the direction of the {@link Sort} to be specified, can be {@literal null}.
52-
* @param properties the properties to sort by, must not be {@literal null} or empty.
53-
* @deprecated use {@link #of(int, int, Direction, String...)} instead.
54-
*/
55-
@Deprecated
56-
public PageRequest(int page, int size, Direction direction, String... properties) {
57-
this(page, size, Sort.by(direction, properties));
58-
}
59-
6033
/**
6134
* Creates a new {@link PageRequest} with sort parameters applied.
6235
*
6336
* @param page zero-based page index.
6437
* @param size the size of the page to be returned.
65-
* @param sort can be {@literal null}.
66-
* @deprecated since 2.0, use {@link #of(int, int, Sort)} instead.
38+
* @param sort must not be {@literal null}, use {@link Sort#unsorted()} instead.
6739
*/
68-
@Deprecated
69-
public PageRequest(int page, int size, Sort sort) {
40+
protected PageRequest(int page, int size, Sort sort) {
7041

7142
super(page, size);
7243

@@ -89,7 +60,7 @@ public static PageRequest of(int page, int size) {
8960
*
9061
* @param page zero-based page index.
9162
* @param size the size of the page to be returned.
92-
* @param sort must not be {@literal null}.
63+
* @param sort must not be {@literal null}, use {@link Sort#unsorted()} instead.
9364
* @since 2.0
9465
*/
9566
public static PageRequest of(int page, int size, Sort sort) {
@@ -121,6 +92,7 @@ public Sort getSort() {
12192
* (non-Javadoc)
12293
* @see org.springframework.data.domain.Pageable#next()
12394
*/
95+
@Override
12496
public Pageable next() {
12597
return new PageRequest(getPageNumber() + 1, getPageSize(), getSort());
12698
}
@@ -129,6 +101,7 @@ public Pageable next() {
129101
* (non-Javadoc)
130102
* @see org.springframework.data.domain.AbstractPageRequest#previous()
131103
*/
104+
@Override
132105
public PageRequest previous() {
133106
return getPageNumber() == 0 ? this : new PageRequest(getPageNumber() - 1, getPageSize(), getSort());
134107
}
@@ -137,6 +110,7 @@ public PageRequest previous() {
137110
* (non-Javadoc)
138111
* @see org.springframework.data.domain.Pageable#first()
139112
*/
113+
@Override
140114
public Pageable first() {
141115
return new PageRequest(0, getPageSize(), getSort());
142116
}

src/main/java/org/springframework/data/domain/Range.java

-53
Original file line numberDiff line numberDiff line change
@@ -47,41 +47,6 @@ public class Range<T extends Comparable<T>> {
4747
*/
4848
private final @NonNull Bound<T> upperBound;
4949

50-
/**
51-
* Creates a new {@link Range} with the given lower and upper bound. Treats the given values as inclusive bounds. Use
52-
* {@link #Range(Comparable, Comparable, boolean, boolean)} to configure different bound behavior.
53-
*
54-
* @see Range#of(Bound, Bound)
55-
* @param lowerBound can be {@literal null} in case upperBound is not {@literal null}.
56-
* @param upperBound can be {@literal null} in case lowerBound is not {@literal null}.
57-
* @deprecated since 2.0 in favor of {@link Range#of(Bound, Bound)}.
58-
*/
59-
@Deprecated
60-
public Range(T lowerBound, T upperBound) {
61-
this(lowerBound, upperBound, true, true);
62-
}
63-
64-
/**
65-
* Creates a new {@link Range} with the given lower and upper bound as well as the given inclusive/exclusive
66-
* semantics.
67-
*
68-
* @param lowerBound can be {@literal null}.
69-
* @param upperBound can be {@literal null}.
70-
* @param lowerInclusive
71-
* @param upperInclusive
72-
* @deprecated since 2.0. Use {@link Range#of(Bound, Bound)} and {@link Bound} factory methods:
73-
* {@link Bound#inclusive(Comparable)}, {@link Bound#exclusive(Comparable)}/{@link Bound#unbounded()}.
74-
*/
75-
@Deprecated
76-
public Range(T lowerBound, T upperBound, boolean lowerInclusive, boolean upperInclusive) {
77-
78-
this.lowerBound = lowerBound == null ? Bound.unbounded()
79-
: lowerInclusive ? Bound.inclusive(lowerBound) : Bound.exclusive(lowerBound);
80-
81-
this.upperBound = upperBound == null ? Bound.unbounded()
82-
: upperInclusive ? Bound.inclusive(upperBound) : Bound.exclusive(upperBound);
83-
}
84-
8550
/**
8651
* Returns an unbounded {@link Range}.
8752
*
@@ -117,24 +82,6 @@ public static <T extends Comparable<T>> Range<T> of(Bound<T> lowerBound, Bound<T
11782
return new Range<>(lowerBound, upperBound);
11883
}
11984

120-
/**
121-
* @return
122-
* @deprecated since 2.0, use {@link #getLowerBound()} and {@link Bound#isInclusive()}.
123-
*/
124-
@Deprecated
125-
public boolean isLowerInclusive() {
126-
return lowerBound.isInclusive();
127-
}
128-
129-
/**
130-
* @return
131-
* @deprecated since 2.0, use {@link #getUpperBound()} and {@link Bound#isInclusive()}.
132-
*/
133-
@Deprecated
134-
public boolean isUpperInclusive() {
135-
return upperBound.isInclusive();
136-
}
137-
13885
/**
13986
* Returns whether the {@link Range} contains the given value.
14087
*

0 commit comments

Comments
 (0)