Browse Source

DATACMNS-429 - Improved JavaDoc for PageRequest and Sort.

Added a few missing parameter documentations in terms of semantics and nullability.
pull/73/merge
Oliver Gierke 12 years ago
parent
commit
659d64d63b
  1. 18
      src/main/java/org/springframework/data/domain/PageRequest.java
  2. 8
      src/main/java/org/springframework/data/domain/Sort.java

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2008-2013 the original author or authors.
* Copyright 2008-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -36,8 +36,8 @@ public class PageRequest implements Pageable, Serializable { @@ -36,8 +36,8 @@ public class PageRequest implements Pageable, Serializable {
* Creates a new {@link PageRequest}. Pages are zero indexed, thus providing 0 for {@code page} will return the first
* page.
*
* @param size
* @param page
* @param page zero-based page index.
* @param size the size of the page to be returned.
*/
public PageRequest(int page, int size) {
this(page, size, null);
@ -46,10 +46,10 @@ public class PageRequest implements Pageable, Serializable { @@ -46,10 +46,10 @@ public class PageRequest implements Pageable, Serializable {
/**
* Creates a new {@link PageRequest} with sort parameters applied.
*
* @param page
* @param size
* @param direction
* @param properties
* @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.
*/
public PageRequest(int page, int size, Direction direction, String... properties) {
this(page, size, new Sort(direction, properties));
@ -58,8 +58,8 @@ public class PageRequest implements Pageable, Serializable { @@ -58,8 +58,8 @@ public class PageRequest implements Pageable, Serializable {
/**
* Creates a new {@link PageRequest} with sort parameters applied.
*
* @param page
* @param size
* @param page zero-based page index.
* @param size the size of the page to be returned.
* @param sort can be {@literal null}.
*/
public PageRequest(int page, int size, Sort sort) {

8
src/main/java/org/springframework/data/domain/Sort.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2008-2013 the original author or authors.
* Copyright 2008-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -73,7 +73,7 @@ public class Sort implements Iterable<org.springframework.data.domain.Sort.Order @@ -73,7 +73,7 @@ public class Sort implements Iterable<org.springframework.data.domain.Sort.Order
* Creates a new {@link Sort} instance.
*
* @param direction defaults to {@linke Sort#DEFAULT_DIRECTION} (for {@literal null} cases, too)
* @param properties must not be {@literal null} or contain {@literal null} or empty strings
* @param properties must not be {@literal null}, empty or contain {@literal null} or empty strings.
*/
public Sort(Direction direction, String... properties) {
this(direction, properties == null ? new ArrayList<String>() : Arrays.asList(properties));
@ -82,8 +82,8 @@ public class Sort implements Iterable<org.springframework.data.domain.Sort.Order @@ -82,8 +82,8 @@ public class Sort implements Iterable<org.springframework.data.domain.Sort.Order
/**
* Creates a new {@link Sort} instance.
*
* @param direction
* @param properties
* @param direction defaults to {@linke Sort#DEFAULT_DIRECTION} (for {@literal null} cases, too)
* @param properties must not be {@literal null} or contain {@literal null} or empty strings.
*/
public Sort(Direction direction, List<String> properties) {

Loading…
Cancel
Save