Browse Source

Polishing.

Remove superfluous declarations, fix toString description.

See #2824
pull/2838/head
Mark Paluch 3 years ago
parent
commit
69dbb75896
No known key found for this signature in database
GPG Key ID: 4406B84C1661DCD1
  1. 14
      src/main/java/org/springframework/data/domain/ScrollPosition.java
  2. 2
      src/main/java/org/springframework/data/domain/WindowImpl.java

14
src/main/java/org/springframework/data/domain/ScrollPosition.java

@ -38,7 +38,7 @@ public interface ScrollPosition {
* *
* @return will never be {@literal null}. * @return will never be {@literal null}.
*/ */
public static KeysetScrollPosition keyset() { static KeysetScrollPosition keyset() {
return KeysetScrollPosition.initial(); return KeysetScrollPosition.initial();
} }
@ -47,7 +47,7 @@ public interface ScrollPosition {
* *
* @return will never be {@literal null}. * @return will never be {@literal null}.
*/ */
public static OffsetScrollPosition offset() { static OffsetScrollPosition offset() {
return OffsetScrollPosition.initial(); return OffsetScrollPosition.initial();
} }
@ -57,7 +57,7 @@ public interface ScrollPosition {
* @param offset * @param offset
* @return a new {@link OffsetScrollPosition} with the given {@code offset}. * @return a new {@link OffsetScrollPosition} with the given {@code offset}.
*/ */
public static OffsetScrollPosition offset(long offset) { static OffsetScrollPosition offset(long offset) {
return OffsetScrollPosition.of(offset); return OffsetScrollPosition.of(offset);
} }
@ -67,7 +67,7 @@ public interface ScrollPosition {
* @param keys must not be {@literal null}. * @param keys must not be {@literal null}.
* @return will never be {@literal null}. * @return will never be {@literal null}.
*/ */
public static KeysetScrollPosition forward(Map<String, ?> keys) { static KeysetScrollPosition forward(Map<String, ?> keys) {
return of(keys, Direction.FORWARD); return of(keys, Direction.FORWARD);
} }
@ -77,7 +77,7 @@ public interface ScrollPosition {
* @param keys must not be {@literal null}. * @param keys must not be {@literal null}.
* @return will never be {@literal null}. * @return will never be {@literal null}.
*/ */
public static KeysetScrollPosition backward(Map<String, ?> keys) { static KeysetScrollPosition backward(Map<String, ?> keys) {
return of(keys, Direction.BACKWARD); return of(keys, Direction.BACKWARD);
} }
@ -88,14 +88,14 @@ public interface ScrollPosition {
* @param direction must not be {@literal null}. * @param direction must not be {@literal null}.
* @return will never be {@literal null}. * @return will never be {@literal null}.
*/ */
public static KeysetScrollPosition of(Map<String, ?> keys, Direction direction) { static KeysetScrollPosition of(Map<String, ?> keys, Direction direction) {
return KeysetScrollPosition.of(keys, direction); return KeysetScrollPosition.of(keys, direction);
} }
/** /**
* Keyset scrolling direction. * Keyset scrolling direction.
*/ */
public enum Direction { enum Direction {
/** /**
* Forward (default) direction to scroll from the beginning of the results to their end. * Forward (default) direction to scroll from the beginning of the results to their end.

2
src/main/java/org/springframework/data/domain/WindowImpl.java

@ -114,6 +114,6 @@ class WindowImpl<T> implements Window<T> {
@Override @Override
public String toString() { public String toString() {
return "Scroll " + items; return "Window " + items;
} }
} }

Loading…
Cancel
Save