Skip to content

Commit

Permalink
DATACMNS-1496 - Removed deprecations at least introduced in Lovelace.
Browse files Browse the repository at this point in the history
  • Loading branch information
odrotbohm committed Mar 13, 2019
1 parent 78e635f commit 0bf160e
Show file tree
Hide file tree
Showing 39 changed files with 62 additions and 1,900 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -560,19 +560,7 @@ enum StringMatcher {
/**
* Allows to transform the property value before it is used in the query.
*/
interface PropertyValueTransformer extends Function<Optional<Object>, Optional<Object>> {

/**
* For backwards compatibility of clients used to invoke Spring's Converter interface.
*
* @param source
* @return
*/
@Deprecated
default Object convert(Object source) {
return apply(Optional.ofNullable(source)).orElse(null);
}
}
interface PropertyValueTransformer extends Function<Optional<Object>, Optional<Object>> {}

/**
* @author Christoph Strobl
Expand Down Expand Up @@ -699,18 +687,6 @@ public PropertyValueTransformer getPropertyValueTransformer() {
return valueTransformer == null ? NoOpPropertyValueTransformer.INSTANCE : valueTransformer;
}

/**
* Transforms a given source using the {@link PropertyValueTransformer}.
*
* @param source
* @return
* @deprecated since 2.0, use {@link #transformValue(Optional)} instead.
*/
@Deprecated
public Object transformValue(Object source) {
return transformValue(Optional.ofNullable(source)).orElse(null);
}

/**
* Transforms a given source using the {@link PropertyValueTransformer}.
*
Expand Down
38 changes: 6 additions & 32 deletions src/main/java/org/springframework/data/domain/PageRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,43 +30,14 @@ public class PageRequest extends AbstractPageRequest {

private final Sort sort;

/**
* Creates a new {@link PageRequest}. Pages are zero indexed, thus providing 0 for {@code page} will return the first
* page.
*
* @param page zero-based page index.
* @param size the size of the page to be returned.
* @deprecated use {@link #of(int, int)} instead.
*/
@Deprecated
public PageRequest(int page, int size) {
this(page, size, Sort.unsorted());
}

/**
* Creates a new {@link PageRequest} with sort parameters applied.
*
* @param page zero-based page index.
* @param size the size of the page to be returned.
* @param direction the direction of the {@link Sort} to be specified, can be {@literal null}.
* @param properties the properties to sort by, must not be {@literal null} or empty.
* @deprecated use {@link #of(int, int, Direction, String...)} instead.
*/
@Deprecated
public PageRequest(int page, int size, Direction direction, String... properties) {
this(page, size, Sort.by(direction, properties));
}

/**
* Creates a new {@link PageRequest} with sort parameters applied.
*
* @param page zero-based page index.
* @param size the size of the page to be returned.
* @param sort can be {@literal null}.
* @deprecated since 2.0, use {@link #of(int, int, Sort)} instead.
* @param sort must not be {@literal null}, use {@link Sort#unsorted()} instead.
*/
@Deprecated
public PageRequest(int page, int size, Sort sort) {
protected PageRequest(int page, int size, Sort sort) {

super(page, size);

Expand All @@ -89,7 +60,7 @@ public static PageRequest of(int page, int size) {
*
* @param page zero-based page index.
* @param size the size of the page to be returned.
* @param sort must not be {@literal null}.
* @param sort must not be {@literal null}, use {@link Sort#unsorted()} instead.
* @since 2.0
*/
public static PageRequest of(int page, int size, Sort sort) {
Expand Down Expand Up @@ -121,6 +92,7 @@ public Sort getSort() {
* (non-Javadoc)
* @see org.springframework.data.domain.Pageable#next()
*/
@Override
public Pageable next() {
return new PageRequest(getPageNumber() + 1, getPageSize(), getSort());
}
Expand All @@ -129,6 +101,7 @@ public Pageable next() {
* (non-Javadoc)
* @see org.springframework.data.domain.AbstractPageRequest#previous()
*/
@Override
public PageRequest previous() {
return getPageNumber() == 0 ? this : new PageRequest(getPageNumber() - 1, getPageSize(), getSort());
}
Expand All @@ -137,6 +110,7 @@ public PageRequest previous() {
* (non-Javadoc)
* @see org.springframework.data.domain.Pageable#first()
*/
@Override
public Pageable first() {
return new PageRequest(0, getPageSize(), getSort());
}
Expand Down
53 changes: 0 additions & 53 deletions src/main/java/org/springframework/data/domain/Range.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,41 +47,6 @@ public class Range<T extends Comparable<T>> {
*/
private final @NonNull Bound<T> upperBound;

/**
* Creates a new {@link Range} with the given lower and upper bound. Treats the given values as inclusive bounds. Use
* {@link #Range(Comparable, Comparable, boolean, boolean)} to configure different bound behavior.
*
* @see Range#of(Bound, Bound)
* @param lowerBound can be {@literal null} in case upperBound is not {@literal null}.
* @param upperBound can be {@literal null} in case lowerBound is not {@literal null}.
* @deprecated since 2.0 in favor of {@link Range#of(Bound, Bound)}.
*/
@Deprecated
public Range(T lowerBound, T upperBound) {
this(lowerBound, upperBound, true, true);
}

/**
* Creates a new {@link Range} with the given lower and upper bound as well as the given inclusive/exclusive
* semantics.
*
* @param lowerBound can be {@literal null}.
* @param upperBound can be {@literal null}.
* @param lowerInclusive
* @param upperInclusive
* @deprecated since 2.0. Use {@link Range#of(Bound, Bound)} and {@link Bound} factory methods:
* {@link Bound#inclusive(Comparable)}, {@link Bound#exclusive(Comparable)}/{@link Bound#unbounded()}.
*/
@Deprecated
public Range(T lowerBound, T upperBound, boolean lowerInclusive, boolean upperInclusive) {

this.lowerBound = lowerBound == null ? Bound.unbounded()
: lowerInclusive ? Bound.inclusive(lowerBound) : Bound.exclusive(lowerBound);

this.upperBound = upperBound == null ? Bound.unbounded()
: upperInclusive ? Bound.inclusive(upperBound) : Bound.exclusive(upperBound);
}

/**
* Returns an unbounded {@link Range}.
*
Expand Down Expand Up @@ -117,24 +82,6 @@ public static <T extends Comparable<T>> Range<T> of(Bound<T> lowerBound, Bound<T
return new Range<>(lowerBound, upperBound);
}

/**
* @return
* @deprecated since 2.0, use {@link #getLowerBound()} and {@link Bound#isInclusive()}.
*/
@Deprecated
public boolean isLowerInclusive() {
return lowerBound.isInclusive();
}

/**
* @return
* @deprecated since 2.0, use {@link #getUpperBound()} and {@link Bound#isInclusive()}.
*/
@Deprecated
public boolean isUpperInclusive() {
return upperBound.isInclusive();
}

/**
* Returns whether the {@link Range} contains the given value.
*
Expand Down
Loading

0 comments on commit 0bf160e

Please sign in to comment.